early return if 1 element
No need to dedup if there is only 1 element in the vec, can early return
This commit is contained in:
parent
2228ce10c6
commit
cb31373dc2
1 changed files with 1 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue