You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insert a key-value pair into the map without checking if the key
already exists in the map.
This operation is safe if a key does not exist in the map.
However, if a key exists in the map already, the behavior is
unspecified: this operation may panic, or any following operation
with the map may panic or return arbitrary result.
This operation is faster than regular insert, because it does not
perform lookup before insertion.
This operation is useful during initial population of the map. For
example, when constructing a map from another map, we know that
keys are unique.
Simple benchmark of `insert` vs `insert_no_overwrite_unchecked` included:
```
test insert ... bench: 14,112 ns/iter (+/- 1,653)
test insert_no_overwrite_unchecked ... bench: 11,099 ns/iter (+/- 1,100)
```
0 commit comments