diff options
author | Emilio Cobos Álvarez <emilio@crisal.io> | 2023-06-18 14:10:52 +0200 |
---|---|---|
committer | Martin Robinson <mrobinson@igalia.com> | 2023-08-16 17:46:41 +0200 |
commit | 80d2c8f22b468b8739bc107eddee44eeacc2141d (patch) | |
tree | 5bbc84e758de241275875b9f7356154fbdb8af8b /components/style/gecko/snapshot_helpers.rs | |
parent | 739d6d14ab09b32a90765f7656535c9bdeef7a7a (diff) | |
download | servo-80d2c8f22b468b8739bc107eddee44eeacc2141d.tar.gz servo-80d2c8f22b468b8739bc107eddee44eeacc2141d.zip |
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
Diffstat (limited to 'components/style/gecko/snapshot_helpers.rs')
-rw-r--r-- | components/style/gecko/snapshot_helpers.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/components/style/gecko/snapshot_helpers.rs b/components/style/gecko/snapshot_helpers.rs index 3cb325bb6b1..d75cd275310 100644 --- a/components/style/gecko/snapshot_helpers.rs +++ b/components/style/gecko/snapshot_helpers.rs @@ -44,14 +44,14 @@ unsafe fn get_class_or_part_from_attr(attr: &structs::nsAttrValue) -> Class { structs::nsAttrValue_ValueType_eAtomArray ); // NOTE: Bindgen doesn't deal with AutoTArray, so cast it below. - let array: *mut u8 = *(*container) + let attr_array: *mut _ = *(*container) .__bindgen_anon_1 .mValue .as_ref() .__bindgen_anon_1 .mAtomArray .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); } debug_assert_eq!(base_type, structs::nsAttrValue_ValueBaseType_eStringBase); |