Commit 9857fe0
authored
No-op ConcurrentStack.PushRange(T[]) if empty (#62126)
* No-op ConcurrentStack.PushRange(T[]) if empty
Resolves #62121.
* Add more bounds checks
Assert that ArgumentOutOfRangeException is thrown if specifying indexes for an empty array with PushRange(T[], int, int).
* Review feedback
Allow out-of-bounds index on empty array if count is zero.
* Add extra test case
Add a further test case for a non-empty array but with a count parameter value of zero.1 parent 8f87ac7 commit 9857fe0
File tree
2 files changed
+33
-2
lines changed- src/libraries/System.Collections.Concurrent
- src/System/Collections/Concurrent
- tests
2 files changed
+33
-2
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
352 | | - | |
353 | 352 | | |
354 | 353 | | |
355 | 354 | | |
| |||
410 | 409 | | |
411 | 410 | | |
412 | 411 | | |
413 | | - | |
| 412 | + | |
414 | 413 | | |
415 | 414 | | |
416 | 415 | | |
| |||
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
66 | 97 | | |
67 | 98 | | |
68 | 99 | | |
| |||
134 | 165 | | |
135 | 166 | | |
136 | 167 | | |
| 168 | + | |
137 | 169 | | |
138 | 170 | | |
139 | 171 | | |
| |||
0 commit comments