Skip to content

Commit

Permalink
Remove unnecessary parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
paulirwin committed Nov 3, 2024
1 parent acbe611 commit 8cbdf96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Lucene.Net/Util/FixedBitSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ public void Flip(int startIndex, int endIndex)
*/

long startmask = -1L << startIndex;
long endmask = (-1L) >>> -endIndex; // 64-(endIndex&0x3f) is the same as -endIndex due to wrap
long endmask = -1L >>> -endIndex; // 64-(endIndex&0x3f) is the same as -endIndex due to wrap

if (startWord == endWord)
{
Expand Down Expand Up @@ -641,7 +641,7 @@ public void Set(int startIndex, int endIndex)
int endWord = (endIndex - 1) >> 6;

long startmask = -1L << startIndex;
long endmask = (-1L) >>> -endIndex; // 64-(endIndex&0x3f) is the same as -endIndex due to wrap
long endmask = -1L >>> -endIndex; // 64-(endIndex&0x3f) is the same as -endIndex due to wrap

if (startWord == endWord)
{
Expand Down
6 changes: 3 additions & 3 deletions src/Lucene.Net/Util/OpenBitSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ public virtual void Clear(int startIndex, int endIndex) // LUCENENET TODO: API:
// word to be changed.
int endWord = ((endIndex - 1) >> 6);

long startmask = (-1L) << startIndex; // -1 << (startIndex mod 64)
long endmask = (-1L) << endIndex; // -1 << (endIndex mod 64)
long startmask = -1L << startIndex; // -1 << (startIndex mod 64)
long endmask = -1L << endIndex; // -1 << (endIndex mod 64)
if ((endIndex & 0x3f) == 0)
{
endmask = 0;
Expand Down Expand Up @@ -466,7 +466,7 @@ public virtual void Clear(long startIndex, long endIndex) // LUCENENET TODO: API
int endWord = (int)((endIndex - 1) >> 6);

long startmask = -1L << (int)startIndex;
long endmask = (-1L) >>> ((int)-endIndex); // 64-(endIndex&0x3f) is the same as -endIndex due to wrap
long endmask = -1L >>> (int)-endIndex; // 64-(endIndex&0x3f) is the same as -endIndex due to wrap

// invert masks since we are clearing
startmask = ~startmask;
Expand Down

0 comments on commit 8cbdf96

Please sign in to comment.