mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Replace all sort with unstable sort (#38427)
["When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory."](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.sort) Binary also reduced by 1KB in Release. Testing: No behaviour change as semantically all current usage does not have any pair with `std::cmp::Ordering::Equal`. Signed-off-by: Euclid Ye <euclid.ye@huawei.com>
This commit is contained in:
parent
7c70d811a6
commit
58425f6ae2
4 changed files with 4 additions and 4 deletions
|
@ -127,7 +127,7 @@ mod test {
|
|||
webviews: &WebViewManager<WebView>,
|
||||
) -> Vec<(WebViewId, WebView)> {
|
||||
let mut keys = webviews.webviews.keys().collect::<Vec<_>>();
|
||||
keys.sort();
|
||||
keys.sort_unstable();
|
||||
keys.iter()
|
||||
.map(|&id| (*id, webviews.webviews.get(id).cloned().unwrap()))
|
||||
.collect()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue