changeset 93:c176114fad50

Avoid unnecessary cloning of strings
author Lewin Bormann <lbo@spheniscida.de>
date Sun, 07 Feb 2016 18:25:25 +0000
parents 0a6149c1c052
children 0483ca64eb6b
files src/map.rs
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/map.rs	Sun Feb 07 16:49:26 2016 +0000
+++ b/src/map.rs	Sun Feb 07 18:25:25 2016 +0000
@@ -136,11 +136,11 @@
 
             match e {
                 None => {
-                    self.sorted_output.insert(DictComparableString::wrap(r.key.clone()), vec![r.value]);
+                    self.sorted_output.insert(DictComparableString::wrap(r.key), vec![r.value]);
                 }
                 Some(mut v) => {
                     v.push(r.value);
-                    self.sorted_output.insert(DictComparableString::wrap(r.key.clone()), v);
+                    self.sorted_output.insert(DictComparableString::wrap(r.key), v);
                 }
             }
         }