зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1678077 - Make CssUrl::is_fragment marginally more efficient. r=boris
No need to do utf8 shenanigans for what this function does. Differential Revision: https://phabricator.services.mozilla.com/D97473
This commit is contained in:
Родитель
628b4518df
Коммит
3fff9b61a5
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче