File tree Expand file tree Collapse file tree
src/libraries/Common/src/System/Collections/Generic Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,18 +20,20 @@ internal BitHelper(Span<int> span, bool clear)
2020 internal void MarkBit ( int bitPosition )
2121 {
2222 uint bitArrayIndex = ( uint ) bitPosition / IntSize ;
23- if ( bitArrayIndex < ( uint ) _span . Length )
23+ Span < int > span = _span ;
24+ if ( bitArrayIndex < ( uint ) span . Length )
2425 {
25- _span [ ( int ) bitArrayIndex ] |= ( 1 << ( int ) ( ( uint ) bitPosition % IntSize ) ) ;
26+ span [ ( int ) bitArrayIndex ] |= ( 1 << ( int ) ( ( uint ) bitPosition % IntSize ) ) ;
2627 }
2728 }
2829
2930 internal bool IsMarked ( int bitPosition )
3031 {
3132 uint bitArrayIndex = ( uint ) bitPosition / IntSize ;
33+ Span < int > span = _span ;
3234 return
33- bitArrayIndex < ( uint ) _span . Length &&
34- ( _span [ ( int ) bitArrayIndex ] & ( ( int ) ( ( uint ) bitPosition % IntSize ) ) ) != 0 ;
35+ bitArrayIndex < ( uint ) span . Length &&
36+ ( span [ ( int ) bitArrayIndex ] & ( ( int ) ( ( uint ) bitPosition % IntSize ) ) ) != 0 ;
3537 }
3638
3739 /// <summary>How many ints must be allocated to represent n bits. Returns (n+31)/32, but avoids overflow.</summary>
You can’t perform that action at this time.
0 commit comments