about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJohann Tuffe <tafia973@gmail.com>2015-06-10 10:51:48 +0800
committerJohann Tuffe <tafia973@gmail.com>2015-06-10 10:51:48 +0800
commitcb31373dc26ca447f7a4a142b2ed352677fb55a0 (patch)
tree5d26cd8af3a006d0babd423bf15bc6bd065359c7 /src
parent2228ce10c6d83c17b6346396aa7c7ef9082f1c04 (diff)
downloadrust-cb31373dc26ca447f7a4a142b2ed352677fb55a0.tar.gz
rust-cb31373dc26ca447f7a4a142b2ed352677fb55a0.zip
early return if 1 element
No need to dedup if there is only 1 element in the vec, can early return
Diffstat (limited to 'src')
-rw-r--r--src/libcollections/vec.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 0cc0108fd01..c4921cb8560 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1213,7 +1213,7 @@ impl<T: PartialEq> Vec<T> {
             // Duplicate, advance r. End of vec. Truncate to w.
 
             let ln = self.len();
-            if ln < 1 { return; }
+            if ln <= 1 { return; }
 
             // Avoid bounds checks by using unsafe pointers.
             let p = self.as_mut_ptr();