diff options
Diffstat (limited to 'src/libcore/vec.rs')
| -rw-r--r-- | src/libcore/vec.rs | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs index 56d547874d8..a69655cd125 100644 --- a/src/libcore/vec.rs +++ b/src/libcore/vec.rs @@ -2533,12 +2533,7 @@ impl<A:Copy> iter::CopyableNonstrictIter<A> for @[A] { impl<A:Clone> Clone for ~[A] { #[inline] fn clone(&self) -> ~[A] { - let mut dolly = ~[]; - vec::reserve(&mut dolly, self.len()); - for self.each |item| { - dolly.push(item.clone()); - } - return dolly; + self.map(|item| item.clone()) } } |
