File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed
src/libraries/System.Collections/src/System/Collections/Generic Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -1012,25 +1012,20 @@ public bool MoveNext()
1012
1012
{
1013
1013
PriorityQueue < TElement , TPriority > localQueue = _queue ;
1014
1014
1015
- if ( _version == localQueue . _version && ( ( uint ) _index < ( uint ) localQueue . _size ) )
1015
+ if ( _version != localQueue . _version )
1016
1016
{
1017
- _current = localQueue . _nodes [ _index ] ;
1018
- _index ++ ;
1019
- return true ;
1017
+ ThrowHelper . ThrowVersionCheckFailed ( ) ;
1020
1018
}
1021
1019
1022
- return MoveNextRare ( ) ;
1023
- }
1024
-
1025
- private bool MoveNextRare ( )
1026
- {
1027
- if ( _version != _queue . _version )
1020
+ if ( ( uint ) _index < ( uint ) localQueue . _size )
1028
1021
{
1029
- throw new InvalidOperationException ( SR . InvalidOperation_EnumFailedVersion ) ;
1022
+ _current = localQueue . _nodes [ _index ] ;
1023
+ _index ++ ;
1024
+ return true ;
1030
1025
}
1031
1026
1032
- _index = _queue . _size + 1 ;
1033
1027
_current = default ;
1028
+ _index = - 1 ;
1034
1029
return false ;
1035
1030
}
1036
1031
@@ -1044,7 +1039,7 @@ void IEnumerator.Reset()
1044
1039
{
1045
1040
if ( _version != _queue . _version )
1046
1041
{
1047
- throw new InvalidOperationException ( SR . InvalidOperation_EnumFailedVersion ) ;
1042
+ ThrowHelper . ThrowVersionCheckFailed ( ) ;
1048
1043
}
1049
1044
1050
1045
_index = 0 ;
You can’t perform that action at this time.
0 commit comments