File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,11 @@ public TValue this[int index]
8080 }
8181 set
8282 {
83+ if ( ( uint ) index >= ( uint ) _list . Count )
84+ {
85+ // out of range!
86+ ThrowHelper . ThrowArgumentOutOfRangeException ( index ) ;
87+ }
8388 if ( ! _issetLookup [ index ] )
8489 {
8590 // adding items during iteration is not allowed!
Original file line number Diff line number Diff line change @@ -10,5 +10,11 @@ public static void ThrowBadEnumerationException()
1010 {
1111 throw new InvalidOperationException ( "Collection was modified; enumeration operation may not execute." ) ;
1212 }
13+
14+ [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
15+ public static void ThrowArgumentOutOfRangeException ( int index )
16+ {
17+ throw new ArgumentOutOfRangeException ( nameof ( index ) ) ;
18+ }
1319 }
1420}
You can’t perform that action at this time.
0 commit comments