mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Rollup merge of #17022 - bholley:atom_fast_path, r=nox
Add a fast path for eq_ignore_ascii_case Per https://bugzilla.mozilla.org/show_bug.cgi?id=1363778#c6 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/17022) <!-- Reviewable:end -->
This commit is contained in:
commit
8c9c506f90
1 changed files with 4 additions and 0 deletions
|
@ -239,6 +239,10 @@ impl Atom {
|
|||
|
||||
/// Return whether two atoms are ASCII-case-insensitive matches
|
||||
pub fn eq_ignore_ascii_case(&self, other: &Self) -> bool {
|
||||
if self == other {
|
||||
return true;
|
||||
}
|
||||
|
||||
let a = self.as_slice();
|
||||
let b = other.as_slice();
|
||||
a.len() == b.len() && a.iter().zip(b).all(|(&a16, &b16)| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue