mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Make CssUrl::is_fragment marginally more efficient.
No need to do utf8 shenanigans for what this function does. Differential Revision: https://phabricator.services.mozilla.com/D97473
This commit is contained in:
parent
eb257a4dc3
commit
5277275263
1 changed files with 1 additions and 1 deletions
|
@ -109,7 +109,7 @@ impl CssUrlData {
|
|||
/// Returns true if this URL looks like a fragment.
|
||||
/// See https://drafts.csswg.org/css-values/#local-urls
|
||||
pub fn is_fragment(&self) -> bool {
|
||||
self.as_str().chars().next().map_or(false, |c| c == '#')
|
||||
self.as_str().as_bytes().iter().next().map_or(false, |b| *b == b'#')
|
||||
}
|
||||
|
||||
/// Return the unresolved url as string, or the empty string if it's
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue