Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRolf Bjarne Kvinge <rolf@xamarin.com>2020-10-02 11:13:08 +0300
committerMarek Safar <marek.safar@gmail.com>2020-10-02 11:36:18 +0300
commite2d8af37fa3f9d216974c182ca51421a7d98e2fb (patch)
treeb8943a777e540fb64be01f438aa825791eb434f6
parent102c92088f7818b8d8ca9867358d46cc13f92356 (diff)
Extract common expresion into a variable to simplify code and reduce the number of parenthesis.
-rw-r--r--reflect/Metadata/Tables.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/reflect/Metadata/Tables.cs b/reflect/Metadata/Tables.cs
index 9a7f6cce..bc84c306 100644
--- a/reflect/Metadata/Tables.cs
+++ b/reflect/Metadata/Tables.cs
@@ -450,20 +450,21 @@ namespace IKVM.Reflection.Metadata
{
return new Enumerator(records, table.RowCount - 1, -1, token);
}
- int index = BinarySearch(records, table.RowCount, token & 0xFFFFFF);
+ var maskedToken = token & 0xFFFFFF;
+ int index = BinarySearch(records, table.RowCount, maskedToken);
if (index < 0)
{
return new Enumerator(null, 0, 1, -1);
}
int start = index;
- while (start > 0 && (((records [start - 1].FilterKey & 0xFFFFFF) == (token & 0xFFFFFF)) || ((records [start - 1].FilterKey & 0xFFFFFF) == 0)))
+ while (start > 0 && (((records [start - 1].FilterKey & 0xFFFFFF) == maskedToken) || ((records [start - 1].FilterKey & 0xFFFFFF) == 0)))
{
start--;
}
int end = index;
int max = table.RowCount - 1;
- while (end < max && (((records [end + 1].FilterKey & 0xFFFFFF) == (token & 0xFFFFFF)) || ((records [end + 1].FilterKey & 0xFFFFFF) == 0)))
+ while (end < max && (((records [end + 1].FilterKey & 0xFFFFFF) == maskedToken) || ((records [end + 1].FilterKey & 0xFFFFFF) == 0)))
{
end++;
}