Skip to content

Commit 0f20cae

Browse files
committed
std: Don't copy hash key until we must
1 parent e546c48 commit 0f20cae

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
@@ -131,8 +131,8 @@ mod chained {
131131
ret not_found;
132132
}
133133
present(e) {
134-
let e_key = e.key; // Satisfy alias checker.
135-
if e.hash == h && tbl.eqer(e_key, k) {
134+
// FIXME: This copy of the key is not good for perf
135+
if e.hash == h && tbl.eqer(copy e.key, k) {
136136
#debug("search_tbl: present, comp %u, hash %u, idx %u",
137137
1u, h, idx);
138138
ret found_first(idx, e);

0 commit comments

Comments
 (0)