Title: [101697] trunk/Source/WebCore
Revision
101697
Author
kl...@webkit.org
Date
2011-12-01 12:04:25 -0800 (Thu, 01 Dec 2011)

Log Message

CSSMutableStyleDeclaration: Unnecessary double hash lookup in construction.
<http://webkit.org/b/73564>

Reviewed by Antti Koivisto.

Use HashMap::find() instead of contains() followed by get() on
successful lookup.

* css/CSSMutableStyleDeclaration.cpp:
(WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (101696 => 101697)


--- trunk/Source/WebCore/ChangeLog	2011-12-01 20:02:31 UTC (rev 101696)
+++ trunk/Source/WebCore/ChangeLog	2011-12-01 20:04:25 UTC (rev 101697)
@@ -1,3 +1,16 @@
+2011-12-01  Andreas Kling  <kl...@webkit.org>
+
+        CSSMutableStyleDeclaration: Unnecessary double hash lookup in construction.
+        <http://webkit.org/b/73564>
+
+        Reviewed by Antti Koivisto.
+
+        Use HashMap::find() instead of contains() followed by get() on
+        successful lookup.
+
+        * css/CSSMutableStyleDeclaration.cpp:
+        (WebCore::CSSMutableStyleDeclaration::CSSMutableStyleDeclaration):
+
 2011-11-30  Benjamin Poulain  <benja...@webkit.org>
 
         URLs are encoded in UTF-8, then decoded as if they are Latin1

Modified: trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp (101696 => 101697)


--- trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp	2011-12-01 20:02:31 UTC (rev 101696)
+++ trunk/Source/WebCore/css/CSSMutableStyleDeclaration.cpp	2011-12-01 20:04:25 UTC (rev 101697)
@@ -137,11 +137,14 @@
         const CSSProperty *property = properties[i];
         ASSERT(property);
         bool important = property->isImportant();
-        if (candidates.contains(property->id())) {
-            if (!important && candidates.get(property->id()))
+
+        HashMap<int, bool>::iterator it = candidates.find(property->id());
+        if (it != candidates.end()) {
+            if (!important && it->second)
                 continue;
             removeProperty(property->id(), false, false);
         }
+
         m_properties.append(*property);
         candidates.set(property->id(), important);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to