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
+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.
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,
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;