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

Unified Diff: Source/core/inspector/DOMEditor.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/html/HTMLAnchorElement.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/inspector/DOMEditor.cpp
diff --git a/Source/core/inspector/DOMEditor.cpp b/Source/core/inspector/DOMEditor.cpp
index 1f8956b08845319837ac1c6e0088b171e1af1b12..734077faddb14f82e73742529677da388969266d 100644
--- a/Source/core/inspector/DOMEditor.cpp
+++ b/Source/core/inspector/DOMEditor.cpp
@@ -175,9 +175,10 @@ public:
virtual bool perform(ExceptionState& exceptionState) OVERRIDE
{
- m_hadAttribute = m_element->hasAttribute(m_name);
+ const AtomicString& value = m_element->getAttribute(m_name);
+ m_hadAttribute = !value.isNull();
if (m_hadAttribute)
- m_oldValue = m_element->getAttribute(m_name);
+ m_oldValue = value;
return redo(exceptionState);
}
« no previous file with comments | « Source/core/html/HTMLAnchorElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698