Skip to content

Commit

Permalink
// We can not use Math.DivRem without taking a dependency on System.R…
Browse files Browse the repository at this point in the history
…untime.Extensions

Commit migrated from dotnet/corefx@acc0aeb
  • Loading branch information
AlexRadch committed Dec 15, 2016
1 parent 8247efe commit 5ec6b86
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public BitArray RightShift(int count)
{
throw new ArgumentOutOfRangeException(nameof(count), count, SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();

_version++;
return this;
Expand All @@ -366,7 +365,7 @@ public BitArray RightShift(int count)
if (count < m_length)
{
int shiftCount;
// We can not use Math.DivRem due compilation error
// We can not use Math.DivRem without taking a dependency on System.Runtime.Extensions
int fromIndex = count / BitsPerInt32;
shiftCount = count - fromIndex * BitsPerInt32; // Optimized Rem

Expand Down Expand Up @@ -417,7 +416,6 @@ public BitArray LeftShift(int count)
{
throw new ArgumentOutOfRangeException(nameof(count), count, SR.ArgumentOutOfRange_NeedNonNegNum);
}
Contract.EndContractBlock();

_version++;
return this;
Expand All @@ -429,7 +427,7 @@ public BitArray LeftShift(int count)
int lastIndex = (m_length - 1) / BitsPerInt32;

int shiftCount;
// We can not use Math.DivRem due compilation error
// We can not use Math.DivRem without taking a dependency on System.Runtime.Extensions
lengthToClear = count / BitsPerInt32;
shiftCount = count - lengthToClear * BitsPerInt32; // Optimized Rem

Expand Down

0 comments on commit 5ec6b86

Please sign in to comment.