From e55bb3e76dbbe412b56e7863ff0ccb9ece9d5643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 16 Jan 2018 21:40:17 +0100 Subject: [PATCH] style: Always inline GeckoElement::has_class. It's easier, and probably faster, than trying to inline the function call to Gecko. This symbol is in libxul.so as of right now. --- components/style/gecko/snapshot_helpers.rs | 2 +- components/style/gecko/wrapper.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/gecko/snapshot_helpers.rs b/components/style/gecko/snapshot_helpers.rs index 4c5b65b13cb..f1163d2609f 100644 --- a/components/style/gecko/snapshot_helpers.rs +++ b/components/style/gecko/snapshot_helpers.rs @@ -34,7 +34,7 @@ pub fn has_class( let classes = slice::from_raw_parts(list, n as usize); match case_sensitivity { CaseSensitivity::CaseSensitive => { - classes.iter().any(|ptr| name == WeakAtom::new(*ptr)) + classes.iter().any(|ptr| &**name == WeakAtom::new(*ptr)) } CaseSensitivity::AsciiCaseInsensitive => { classes.iter().any(|ptr| name.eq_ignore_ascii_case(WeakAtom::new(*ptr))) diff --git a/components/style/gecko/wrapper.rs b/components/style/gecko/wrapper.rs index 4cffefdc599..0f8626eaa0e 100644 --- a/components/style/gecko/wrapper.rs +++ b/components/style/gecko/wrapper.rs @@ -2191,7 +2191,7 @@ impl<'le> ::selectors::Element for GeckoElement<'le> { } } - #[inline] + #[inline(always)] fn has_class(&self, name: &Atom, case_sensitivity: CaseSensitivity) -> bool { if !self.may_have_class() { return false;