mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-18 09:53:26 +00:00
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
@ -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…
Reference in New Issue
Block a user