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

Unified Diff: Source/core/html/HTMLAnchorElement.cpp

Issue 183763033: Avoid calling hasAttribute() and then getAttribute() for performance (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 10 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
« no previous file with comments | « Source/core/editing/SplitElementCommand.cpp ('k') | Source/core/inspector/DOMEditor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLAnchorElement.cpp
diff --git a/Source/core/html/HTMLAnchorElement.cpp b/Source/core/html/HTMLAnchorElement.cpp
index 1e4422c7b45ec9deec1a3993ceb7ff494944f7aa..0d2ee69ba29b1b4890d48cb9e7ac5129bd9999ab 100644
--- a/Source/core/html/HTMLAnchorElement.cpp
+++ b/Source/core/html/HTMLAnchorElement.cpp
@@ -393,12 +393,13 @@ bool HTMLAnchorElement::isLiveLink() const
void HTMLAnchorElement::sendPings(const KURL& destinationURL)
{
- if (!hasAttribute(pingAttr) || !document().settings() || !document().settings()->hyperlinkAuditingEnabled())
+ const AtomicString& pingValue = getAttribute(pingAttr);
+ if (pingValue.isNull() || !document().settings() || !document().settings()->hyperlinkAuditingEnabled())
return;
UseCounter::count(document(), UseCounter::HTMLAnchorElementPingAttribute);
- SpaceSplitString pingURLs(getAttribute(pingAttr), false);
+ SpaceSplitString pingURLs(pingValue, false);
for (unsigned i = 0; i < pingURLs.size(); i++)
PingLoader::sendPing(document().frame(), document().completeURL(pingURLs[i]), destinationURL);
}
« no previous file with comments | « Source/core/editing/SplitElementCommand.cpp ('k') | Source/core/inspector/DOMEditor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698