Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(970)

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp

Issue 2148423003: Use StringView for equalIgnoringCase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add rebaselines. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
index 67e9caff836c76efa3d406a4058f54b028526890..b022516db1fb1729e69f6fdf38c1c2c75aaee167 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLTreeBuilderSimulator.cpp
@@ -90,7 +90,9 @@ static bool tokenExitsForeignContent(const CompactHTMLToken& token)
static bool tokenExitsSVG(const CompactHTMLToken& token)
{
// FIXME: It's very fragile that we special case foreignObject here to be case-insensitive.
- return equalIgnoringCaseNonNull(token.data().impl(), SVGNames::foreignObjectTag.localName().impl());
+
+ // Save one branch inside StringView by derefing the StringImpl.
+ return equalIgnoringCaseAndNullity(*token.data().impl(), *SVGNames::foreignObjectTag.localName().impl());
haraken 2016/08/04 09:05:28 Honestly speaking, I'm not sure how much it makes
esprehn 2016/08/04 18:30:07 I can remove the optimization here, but we still w
esprehn 2016/08/04 21:57:19 I removed this optimization but left the one in th
}
static bool tokenExitsMath(const CompactHTMLToken& token)

Powered by Google App Engine
This is Rietveld 408576698