Skip to content

Commit abe0f02

Browse files
authored
fix typos in growth algo description
modified to read "the first table overflows into the second, and the second into the first." plus smaller typos
1 parent 5953454 commit abe0f02

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

+4-4
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)