Closed
Bug 254373
Opened 21 years ago
Closed 21 years ago
[FIX]nsHTMLSelectElement::GetOptionIndex is slow
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
RESOLVED
FIXED
mozilla1.8alpha3
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Keywords: perf)
Attachments
(1 file)
3.38 KB,
patch
|
peterv
:
review+
peterv
:
superreview+
|
Details | Diff | Splinter Review |
This method is doing a lot of COM and QI stuff that's really unnecessary... it
should just be pushed down to where we don't have to worry about all that.
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Comment 2•21 years ago
|
||
Comment on attachment 155234 [details] [diff] [review]
Like so
I considered just doing indexof and comparing its return to aStartIndex, taking
into account aForward, but then I decide maybe caller knows enough to be
passing "almost right" start indices.... (the only caller that passes a nonzero
start index and/or an aForward that's false is XBL form controls anyway).
Attachment #155234 -
Flags: superreview?(peterv)
Attachment #155234 -
Flags: review?(peterv)
Assignee | ||
Updated•21 years ago
|
Comment 3•21 years ago
|
||
Comment on attachment 155234 [details] [diff] [review]
Like so
>+nsHTMLOptionCollection::GetOptionIndex(nsIDOMHTMLOptionElement* aOption,
>+ PRInt32 high = mElements.Count();
>+ PRInt32 low = -1;
>+ PRInt32 step = aForward ? 1 : -1;
>+
>+ for (index = aStartIndex; index < high && index > low; index += step) {
You don't really need low, just use index > -1
Attachment #155234 -
Flags: superreview?(peterv)
Attachment #155234 -
Flags: superreview+
Attachment #155234 -
Flags: review?(peterv)
Attachment #155234 -
Flags: review+
Assignee | ||
Comment 4•21 years ago
|
||
Fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•