[Webkit-unassigned] [Bug 33269] Improve HTMLElement::tagPriority()

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 6 15:02:37 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33269


TAMURA, Kent <tkent at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #45992|0                           |1
        is obsolete|                            |
  Attachment #45999|                            |review?
               Flag|                            |




--- Comment #4 from TAMURA, Kent <tkent at chromium.org>  2010-01-06 15:02:36 PST ---
Created an attachment (id=45999)
 --> (https://bugs.webkit.org/attachment.cgi?id=45999)
Proposed patch (rev.2)

(In reply to comment #3)
> (From update of attachment 45992 [details])
> > +    static const bool emptyValueIsZero = false;
> > +    static const bool needsDestruction = false;
> > +    static int emptyValue() { return 1; }
> > +    static void constructDeletedValue(int& slot) { slot = -1; }
> > +    static bool isDeletedValue(int value) { return value == -1; }
> 
> There's no need for you to override needsDestruction, constructDeletedValue, or
> isDeletedValue. You can just use the inherited versions of those from the base
> class.

ok, I removed them.

> I think it would be best to put the code to initialize the map into a separate
> function, initializeTagPriorityMap, that takes the map as an argument. That
> will make the tagPriorityMap function easier to read and even ever so slightly
> more efficient since it will be smaller with better code locality.

Done.

> Is there a guarantee that localName().impl() is never 0?

I think so for the current code though there is no ASSERTION for it.
However, 0 makes no problems because the HashMap key is AtomicStringImpl*. The
generic PtrHash is used and tagPriorityMap.get(0) simply returns emptyValue().

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list