Improve the efficiency of SecurityOriginHash
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2008 16:34:28 +0000 (16:34 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2008 16:34:28 +0000 (16:34 +0000)
        Reviewed by Alexey.

        * platform/SecurityOriginHash.h:
        (WebCore::SecurityOriginHash::hash): Now takes a const
        RefPtr<SecurityOrigin>& to reduce ref-count churn.
        (WebCore::SecurityOriginHash::equal): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/SecurityOriginHash.h

index 32fdb92d92d16ca9d7fbd9fc1d416028080515dd..8b37cb601b53dcdfe8a865b6c0ff6dee9ae27684 100644 (file)
@@ -1,3 +1,14 @@
+2008-02-14  Adam Roben  <aroben@apple.com>
+
+        Improve the efficiency of SecurityOriginHash
+
+        Reviewed by Alexey.
+
+        * platform/SecurityOriginHash.h:
+        (WebCore::SecurityOriginHash::hash): Now takes a const
+        RefPtr<SecurityOrigin>& to reduce ref-count churn.
+        (WebCore::SecurityOriginHash::equal): Ditto.
+
 2008-02-13  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by Oliver Hunt.
index 78814748e0faa73af3c91a7afc08ac7a7aa418ff..a5f25e590f404d9da22fead3fa525ad0e6713d38 100644 (file)
@@ -35,7 +35,7 @@
 namespace WebCore {
 
 struct SecurityOriginHash {
-    static unsigned hash(RefPtr<SecurityOrigin> origin)
+    static unsigned hash(const RefPtr<SecurityOrigin>& origin)
     {
         unsigned hashCodes[3] = {
             origin->protocol().impl() ? origin->protocol().impl()->hash() : 0,
@@ -45,7 +45,7 @@ struct SecurityOriginHash {
         return StringImpl::computeHash(reinterpret_cast<UChar*>(hashCodes), 3 * sizeof(unsigned) / sizeof(UChar));
     }
          
-    static bool equal(RefPtr<SecurityOrigin> a, RefPtr<SecurityOrigin> b)
+    static bool equal(const RefPtr<SecurityOrigin>& a, const RefPtr<SecurityOrigin>& b)
     {
         if (a == 0 || b == 0)
             return a == b;