about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-05-18 16:50:16 -0700
committerBrian Anderson <banderson@mozilla.com>2012-05-18 16:50:16 -0700
commit0f20cae37fd703f344d226170ebe440ab76fe565 (patch)
tree4b7d5ff96dbf867f47c6ab97ccc93b1405b4ee09 /src/libstd
parente546c4820b081dc5dc30634b0b2eb3feed2041aa (diff)
downloadrust-0f20cae37fd703f344d226170ebe440ab76fe565.tar.gz
rust-0f20cae37fd703f344d226170ebe440ab76fe565.zip
std: Don't copy hash key until we must
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/map.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/map.rs b/src/libstd/map.rs
index a72e87475b2..9d0f7b4c383 100644
--- a/src/libstd/map.rs
+++ b/src/libstd/map.rs
@@ -131,8 +131,8 @@ mod chained {
             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);