Skip to content

Commit 13a3288

Browse files
committed
dec size in remove
1 parent ddfe82a commit 13a3288

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/map.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,7 @@ mod chained {
155155

156156
fn search_tbl<copy K, copy V>(
157157
tbl: t<K,V>, k: K, h: uint) -> search_result<K,V> {
158-
159158
let idx = h % vec::len(tbl.chains);
160-
161159
alt tbl.chains[idx] {
162160
absent. {
163161
ret not_found;
@@ -221,11 +219,13 @@ mod chained {
221219
}
222220

223221
found_first(idx, entry) {
222+
tbl.size -= 1u;
224223
tbl.chains[idx] = entry.next;
225224
ret option::some(entry.value);
226225
}
227226

228227
found_after(eprev, entry) {
228+
tbl.size -= 1u;
229229
eprev.next = entry.next;
230230
ret option::some(entry.value);
231231
}

0 commit comments

Comments
 (0)