mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 06:28:20 +03:00
std: Don't copy hash key until we must
This commit is contained in:
+2
-2
@@ -131,8 +131,8 @@ fn search_tbl<K: copy, V: copy>(
|
||||
ret not_found;
|
||||
}
|
||||
present(e) {
|
||||
let e_key = e.key; // Satisfy alias checker.
|
||||
if e.hash == h && tbl.eqer(e_key, k) {
|
||||
// FIXME: This copy of the key is not good for perf
|
||||
if e.hash == h && tbl.eqer(copy e.key, k) {
|
||||
#debug("search_tbl: present, comp %u, hash %u, idx %u",
|
||||
1u, h, idx);
|
||||
ret found_first(idx, e);
|
||||
|
||||
Reference in New Issue
Block a user