about summary refs log tree commit diff
path: root/src/libcore/dvec.rs
diff options
context:
space:
mode:
authorEric Holk <eric.holk@gmail.com>2012-06-13 16:14:01 -0700
committerEric Holk <eric.holk@gmail.com>2012-06-21 16:11:11 -0700
commit0e5cfd9f339c78384ef3fbcb4d230fa0bb363d54 (patch)
treef71eefbe17ea2b94ab475a0bc63f690a1ea339e4 /src/libcore/dvec.rs
parentf8fa0a243788e6b1028d254958cd19c6f10034fa (diff)
Move vector addition out of trans and into libcore.
Diffstat (limited to 'src/libcore/dvec.rs')
-rw-r--r--src/libcore/dvec.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libcore/dvec.rs b/src/libcore/dvec.rs
index 3ea8de957a0..ef368fe7a8b 100644
--- a/src/libcore/dvec.rs
+++ b/src/libcore/dvec.rs
@@ -137,7 +137,9 @@ impl extensions<A:copy> for dvec<A> {
     #[doc = "Append a single item to the end of the list"]
     fn push(t: A) {
         self.swap { |v|
-            let mut v <- v; v += [t]; v // more efficient than v + [t]
+            let mut v <- v;
+            vec::push(v, t);
+            v
         }
     }
 
@@ -170,7 +172,7 @@ impl extensions<A:copy> for dvec<A> {
             vec::reserve(v, new_len);
             let mut i = from_idx;
             while i < to_idx {
-                v += [ts[i]];
+                vec::push(v, ts[i]);
                 i += 1u;
             }
             v