about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2015-06-10 22:07:10 +0530
committerManish Goregaokar <manishsmail@gmail.com>2015-06-10 22:07:10 +0530
commitbd7a6ec8ecdf0dadd88aae0040a5cf0d00e2f32f (patch)
tree5d72b4ecc1bc6b45ca2846b3b294db40fd141277 /src
parent7d9427e6cd798e24b4be633aa4bf459bd232400c (diff)
parentcb31373dc26ca447f7a4a142b2ed352677fb55a0 (diff)
downloadrust-bd7a6ec8ecdf0dadd88aae0040a5cf0d00e2f32f.tar.gz
rust-bd7a6ec8ecdf0dadd88aae0040a5cf0d00e2f32f.zip
Rollup merge of #26164 - tafia:early-dedup, r=Gankro
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 e7b700119f9..49f6fa53b01 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 raw pointers.
             let p = self.as_mut_ptr();