aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/gecko/snapshot_helpers.rs
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2023-06-18 14:10:52 +0200
committerMartin Robinson <mrobinson@igalia.com>2023-08-16 17:46:41 +0200
commit80d2c8f22b468b8739bc107eddee44eeacc2141d (patch)
tree5bbc84e758de241275875b9f7356154fbdb8af8b /components/style/gecko/snapshot_helpers.rs
parent739d6d14ab09b32a90765f7656535c9bdeef7a7a (diff)
downloadservo-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.rs4
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);