Last Comment Bug 697917 - Avoid atomizing the token for nsDOMTokenList containment tests
: Avoid atomizing the token for nsDOMTokenList containment tests
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: unspecified
: All All
: P2 normal (vote)
: mozilla10
Assigned To: Boris Zbarsky [:bz]
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-10-27 19:14 PDT by Boris Zbarsky [:bz]
Modified: 2011-10-29 01:47 PDT (History)
3 users (show)
bzbarsky: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Avoid atomizing the token for nsDOMTokenList containment tests. (6.10 KB, patch)
2011-10-27 19:15 PDT, Boris Zbarsky [:bz]
bugs: review+
Details | Diff | Splinter Review

Description Boris Zbarsky [:bz] 2011-10-27 19:14:24 PDT
We can easily do them on the string itself, and in the common case (few classes) the atomization is more expensive than just comparing strings.
Comment 1 Boris Zbarsky [:bz] 2011-10-27 19:15:38 PDT
Created attachment 570156 [details] [diff] [review]
Avoid atomizing the token for nsDOMTokenList containment tests.
Comment 2 Olli Pettay [:smaug] (vacation Aug 25-28) 2011-10-28 06:55:36 PDT
Comment on attachment 570156 [details] [diff] [review]
Avoid atomizing the token for nsDOMTokenList containment tests.

Looks like nsTArray documentation is a bit wrong
http://mxr.mozilla.org/mozilla-central/source/xpcom/glue/nsTArray.h#410
Comparator::Equals parameters both have elem_type, but the latter one
could be actually something else like in this patch.
Comment 3 Boris Zbarsky [:bz] 2011-10-28 08:14:06 PDT
Good catch.  I'll fix the docs.
Comment 5 Marco Bonardo [::mak] 2011-10-29 01:47:08 PDT
https://hg.mozilla.org/mozilla-central/rev/0371519c061e

Note You need to log in before you can comment on or make changes to this bug.