diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2018-11-03 20:21:05 +0100 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2018-11-05 08:20:31 +0100 |
commit | 08a535a4cbc0b8e0a6e33570d50e8a9e7b7ff35b (patch) | |
tree | 1a86dbb79667d06cffb131b59fe95e6c78cfe9d0 /components/script/dom/formdata.rs | |
parent | 176d984b3badba7265f3e7442159adcb54d8b90e (diff) | |
download | servo-08a535a4cbc0b8e0a6e33570d50e8a9e7b7ff35b.tar.gz servo-08a535a4cbc0b8e0a6e33570d50e8a9e7b7ff35b.zip |
Use a BTreeMap to store formdata
I'm really unsure about the MallocSizeOf of BTreeMap as I took the same
code as for HashMap.
Fixes #13105
Fixes #21381
Diffstat (limited to 'components/script/dom/formdata.rs')
-rw-r--r-- | components/script/dom/formdata.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/formdata.rs b/components/script/dom/formdata.rs index 1ec80600ba4..7511941abb9 100644 --- a/components/script/dom/formdata.rs +++ b/components/script/dom/formdata.rs @@ -18,19 +18,19 @@ use dom::globalscope::GlobalScope; use dom::htmlformelement::{HTMLFormElement, FormDatumValue, FormDatum}; use dom_struct::dom_struct; use html5ever::LocalName; -use std::collections::HashMap; -use std::collections::hash_map::Entry::{Occupied, Vacant}; +use std::collections::BTreeMap; +use std::collections::btree_map::Entry::{Occupied, Vacant}; use std::iter; #[dom_struct] pub struct FormData { reflector_: Reflector, - data: DomRefCell<HashMap<LocalName, Vec<FormDatum>>>, + data: DomRefCell<BTreeMap<LocalName, Vec<FormDatum>>>, } impl FormData { fn new_inherited(opt_form: Option<&HTMLFormElement>) -> FormData { - let mut hashmap: HashMap<LocalName, Vec<FormDatum>> = HashMap::new(); + let mut hashmap: BTreeMap<LocalName, Vec<FormDatum>> = BTreeMap::new(); if let Some(form) = opt_form { for datum in form.get_form_dataset(None) { |