mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Removed pdqsort dependency and changed style create to use stdlib sort method.
This commit is contained in:
parent
3209d22968
commit
dd02d7a8f8
4 changed files with 1 additions and 18 deletions
|
@ -60,7 +60,6 @@ num-traits = "0.1.32"
|
|||
ordered-float = "0.4"
|
||||
owning_ref = "0.3.3"
|
||||
parking_lot = "0.4"
|
||||
pdqsort = "0.1.0"
|
||||
precomputed-hash = "0.1.1"
|
||||
rayon = "0.8.2"
|
||||
selectors = { path = "../selectors" }
|
||||
|
|
|
@ -73,7 +73,6 @@ extern crate num_traits;
|
|||
extern crate ordered_float;
|
||||
extern crate owning_ref;
|
||||
extern crate parking_lot;
|
||||
extern crate pdqsort;
|
||||
extern crate precomputed_hash;
|
||||
extern crate rayon;
|
||||
extern crate selectors;
|
||||
|
|
|
@ -12,7 +12,6 @@ use dom::TElement;
|
|||
use fallible::FallibleVec;
|
||||
use hash::{HashMap, HashSet, DiagnosticHashMap};
|
||||
use hashglobe::FailedAllocationError;
|
||||
use pdqsort::sort_by;
|
||||
use precomputed_hash::PrecomputedHash;
|
||||
use rule_tree::CascadeLevel;
|
||||
use selector_parser::SelectorImpl;
|
||||
|
@ -111,11 +110,6 @@ pub struct SelectorMap<T: 'static> {
|
|||
pub count: usize,
|
||||
}
|
||||
|
||||
#[inline]
|
||||
fn sort_by_key<T, F: Fn(&T) -> K, K: Ord>(v: &mut [T], f: F) {
|
||||
sort_by(v, |a, b| f(a).cmp(&f(b)))
|
||||
}
|
||||
|
||||
// FIXME(Manishearth) the 'static bound can be removed when
|
||||
// our HashMap fork (hashglobe) is able to use NonZero,
|
||||
// or when stdlib gets fallible collections
|
||||
|
@ -227,8 +221,7 @@ impl SelectorMap<Rule> {
|
|||
cascade_level);
|
||||
|
||||
// Sort only the rules we just added.
|
||||
sort_by_key(&mut matching_rules_list[init_len..],
|
||||
|block| (block.specificity, block.source_order()));
|
||||
matching_rules_list[init_len..].sort_unstable_by_key(|block| (block.specificity, block.source_order()));
|
||||
}
|
||||
|
||||
/// Adds rules in `rules` that match `element` to the `matching_rules` list.
|
||||
|
@ -523,4 +516,3 @@ impl<V: 'static> MaybeCaseInsensitiveHashMap<Atom, V> {
|
|||
self.0.end_mutation();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue