diff options
-rw-r--r-- | Cargo.lock | 7 | ||||
-rw-r--r-- | components/style/Cargo.toml | 1 | ||||
-rw-r--r-- | components/style/lib.rs | 1 | ||||
-rw-r--r-- | components/style/selector_map.rs | 10 |
4 files changed, 1 insertions, 18 deletions
diff --git a/Cargo.lock b/Cargo.lock index b3629688a63..79aab1417dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2266,11 +2266,6 @@ dependencies = [ ] [[package]] -name = "pdqsort" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] name = "peeking_take_while" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -3160,7 +3155,6 @@ dependencies = [ "ordered-float 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", - "pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "precomputed-hash 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -3946,7 +3940,6 @@ dependencies = [ "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" "checksum parking_lot_core 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4f610cb9664da38e417ea3225f23051f589851999535290e077939838ab7a595" "checksum parse-hosts 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3842db828281691db6e6f1709ed6a73025747c0cd15cc10346a5cb021e2bc28" -"checksum pdqsort 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ceca1642c89148ca05611cc775a0c383abef355fc4907c4e95f49f7b09d6287c" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" "checksum percent-encoding 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "de154f638187706bde41d9b4738748933d64e6b37bdbffc0b47a97d16a6ae356" "checksum phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)" = "cb325642290f28ee14d8c6201159949a872f220c62af6e110a56ea914fbe42fc" diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 1e61fbc2299..140c1b7d094 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -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" } diff --git a/components/style/lib.rs b/components/style/lib.rs index b4b40cf56db..00a83d1f39a 100644 --- a/components/style/lib.rs +++ b/components/style/lib.rs @@ -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; diff --git a/components/style/selector_map.rs b/components/style/selector_map.rs index f44eea6fddd..9e0f01a2c9f 100644 --- a/components/style/selector_map.rs +++ b/components/style/selector_map.rs @@ -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(); } } - |