Closed
Bug 838301
Opened 11 years ago
Closed 11 years ago
Make nsAutoCompleteController.cpp use nsCOMArray::Length() & IsEmpty() instead of Count(), where appropriate
Categories
(Toolkit :: Autocomplete, defect)
Toolkit
Autocomplete
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: dholbert, Assigned: dholbert)
References
Details
Attachments
(1 file)
6.76 KB,
patch
|
mounir
:
review+
|
Details | Diff | Splinter Review |
Neil has just added an unsigned "Length()" method on nsCOMArray, in Bug 493711, which makes the casting hacks from e.g. bug 836345 no longer necessary in nsAutoCompleteController.cpp. I'm filing this bug on cleaning up nsAutoCompleteController.cpp to use Length() instead of Count() where appropriate. (Basically everywhere, except when we explicitly want an unsigned count.)
Assignee | ||
Comment 1•11 years ago
|
||
Note that the member-variable 'mSearchesOngoing' is unsigned. (That's why the patch changes an instance of mSearchesOngoing = ...Count() to ...Length().) I believe the types of any other involved variables should be clear from the patch-context. (The patch also drops a number of 'count' local variables that are only there as part of a loop condition. It's unlikely that those variables buy us any optimizations, since nsCOMArray::Length() and its helper nsTArray::Length() are both defined in header files and hence can be inlined, and they simply return a member variable on the inner nsTArray.)
Assignee | ||
Updated•11 years ago
|
OS: Linux → All
Hardware: x86_64 → All
Version: unspecified → Trunk
Assignee | ||
Updated•11 years ago
|
Summary: Make nsAutoCompleteController.cpp use nsCOMArray::Length() instead of Count(), where appropriate → Make nsAutoCompleteController.cpp use nsCOMArray::Length() & IsEmpty() instead of Count(), where appropriate
Updated•11 years ago
|
Attachment #710339 -
Flags: review?(mounir) → review+
Assignee | ||
Comment 2•11 years ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #0) > I'm filing this bug on cleaning up nsAutoCompleteController.cpp to use > Length() instead of Count() where appropriate. (Basically everywhere, except > when we explicitly want an unsigned count.) (er, meant to say "except where we explicitly want a _signed_ count")
Assignee | ||
Comment 3•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/df4d7016b841
Flags: in-testsuite-
Whiteboard:
Comment 4•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/df4d7016b841
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Whiteboard:
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•