diff options
author | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2020-10-02 11:13:08 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2020-10-02 11:36:18 +0300 |
commit | e2d8af37fa3f9d216974c182ca51421a7d98e2fb (patch) | |
tree | b8943a777e540fb64be01f438aa825791eb434f6 | |
parent | 102c92088f7818b8d8ca9867358d46cc13f92356 (diff) |
Extract common expresion into a variable to simplify code and reduce the number of parenthesis.
-rw-r--r-- | reflect/Metadata/Tables.cs | 7 |
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++; } |