Skip to content

Commit 13ec061

Browse files
authored
Rollup merge of #54107 - thevaleriemack:master, r=Mark-Simulacrum
Fix typos in libstd hash map modified growth algo description to read "the first table overflows into the second, and the second into the first." plus smaller typos
2 parents 2889015 + abe0f02 commit 13ec061

File tree

1 file changed

+4
-4
lines changed
  • src/libstd/collections/hash

1 file changed

+4
-4
lines changed

src/libstd/collections/hash/map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,14 @@ impl DefaultResizePolicy {
166166
// Our hash generation scheme consists of generating a 64-bit hash and
167167
// truncating the most significant bits. When moving to the new table, we
168168
// simply introduce a new bit to the front of the hash. Therefore, if an
169-
// elements has ideal index i in the old table, it can have one of two ideal
169+
// element has ideal index i in the old table, it can have one of two ideal
170170
// locations in the new table. If the new bit is 0, then the new ideal index
171171
// is i. If the new bit is 1, then the new ideal index is n + i. Intuitively,
172172
// we are producing two independent tables of size n, and for each element we
173173
// independently choose which table to insert it into with equal probability.
174-
// However the rather than wrapping around themselves on overflowing their
175-
// indexes, the first table overflows into the first, and the first into the
176-
// second. Visually, our new table will look something like:
174+
// However, rather than wrapping around themselves on overflowing their
175+
// indexes, the first table overflows into the second, and the second into the
176+
// first. Visually, our new table will look something like:
177177
//
178178
// [yy_xxx_xxxx_xxx|xx_yyy_yyyy_yyy]
179179
//

0 commit comments

Comments
 (0)