1
Fork 0

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
This commit is contained in:
Manish Goregaokar 2015-06-10 22:07:10 +05:30
commit bd7a6ec8ec

View file

@ -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();