[webkit-reviews] review granted: [Bug 115410] Change HashTraits<RefPtr<P> >::PassOutType to PassRefPtr for better performance : [Attachment 200406] patch v2

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 6 09:09:21 PDT 2013


Darin Adler <darin at apple.com> has granted Mikhail Pozdnyakov
<mikhail.pozdnyakov at intel.com>'s request for review:
Bug 115410: Change HashTraits<RefPtr<P> >::PassOutType to PassRefPtr for better
performance
https://bugs.webkit.org/show_bug.cgi?id=115410

Attachment 200406: patch v2
https://bugs.webkit.org/attachment.cgi?id=200406&action=review

------- Additional Comments from Darin Adler <darin at apple.com>
View in context: https://bugs.webkit.org/attachment.cgi?id=200406&action=review


> Source/WTF/wtf/HashTable.h:304
>	   template<typename T> static bool equal(const T& a, const T& b) {
return HashFunctions::equal(a, b); }
> +	   template<typename T, typename U> static bool equal(const T& a, const
U& b) { return HashFunctions::equal(a, b); }

When we add the two-type equal function template, we should remove the old
single-type function template. No need to keep both.

>> Source/WTF/wtf/HashTraits.h:141
>> +	    static P* emptyValue() { return 0; }
> 
> it's probably worth adding "static const bool emptyValueIsZero = true;"

Doesn’t need to be added. SimpleClassHashTraits provides that.

> Source/WTF/wtf/HashTraits.h:149
> +	   static PassRefPtr<P> passOut(P* value) { return value; }
>	   // FIXME: We should consider changing PeekType to a raw pointer for
better performance,

I suggest a blank line here so that PassOutType and PeekType are in separate
paragraphs.


More information about the webkit-reviews mailing list