mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
style: Deduplicate TokenList values faster
Remember whether we have already de-duplicated them once and avoid doing that again. This is an alternative approach that doesn't add overhead to attribute setting in the general case. Differential Revision: https://phabricator.services.mozilla.com/D142813
This commit is contained in:
parent
739d6d14ab
commit
80d2c8f22b
1 changed files with 2 additions and 2 deletions
|
@ -44,14 +44,14 @@ unsafe fn get_class_or_part_from_attr(attr: &structs::nsAttrValue) -> Class {
|
||||||
structs::nsAttrValue_ValueType_eAtomArray
|
structs::nsAttrValue_ValueType_eAtomArray
|
||||||
);
|
);
|
||||||
// NOTE: Bindgen doesn't deal with AutoTArray, so cast it below.
|
// NOTE: Bindgen doesn't deal with AutoTArray, so cast it below.
|
||||||
let array: *mut u8 = *(*container)
|
let attr_array: *mut _ = *(*container)
|
||||||
.__bindgen_anon_1
|
.__bindgen_anon_1
|
||||||
.mValue
|
.mValue
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.__bindgen_anon_1
|
.__bindgen_anon_1
|
||||||
.mAtomArray
|
.mAtomArray
|
||||||
.as_ref();
|
.as_ref();
|
||||||
let array = array as *const structs::nsTArray<structs::RefPtr<nsAtom>>;
|
let array = (*attr_array).mArray.as_ptr() as *const structs::nsTArray<structs::RefPtr<nsAtom>>;
|
||||||
return Class::More(&**array);
|
return Class::More(&**array);
|
||||||
}
|
}
|
||||||
debug_assert_eq!(base_type, structs::nsAttrValue_ValueBaseType_eStringBase);
|
debug_assert_eq!(base_type, structs::nsAttrValue_ValueBaseType_eStringBase);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue