Commit a8b2c92
authored
Reduce redundant lookup in OrderedDictionary<TKey, TValue>.Remove (#128988)
This PR reduces a redundant lookup in `OrderedDictionary<TKey,
TValue>.Remove(KeyValuePair<TKey, TValue>)` by using the index obtained
from `TryGetValue` to call `RemoveAt`.
I also removed a duplicated null check in `IDictionary.Add`.1 parent 055beba commit a8b2c92
1 file changed
Lines changed: 10 additions & 9 deletions
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1218 | 1218 | | |
1219 | 1219 | | |
1220 | 1220 | | |
1221 | | - | |
1222 | | - | |
1223 | | - | |
1224 | | - | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1225 | 1231 | | |
1226 | 1232 | | |
1227 | 1233 | | |
| |||
1237 | 1243 | | |
1238 | 1244 | | |
1239 | 1245 | | |
1240 | | - | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | 1246 | | |
1246 | 1247 | | |
1247 | 1248 | | |
| |||
0 commit comments