Closed Bug 1409152 Opened 2 years ago Closed 2 years ago

Add an nsTArray::ContainsSorted() function that works like Contains() but assumes the array is sorted

Categories

(Core :: XPCOM, enhancement)

53 Branch
enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Because binary search is better than linear search.
Duplicate of this bug: 1409182
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Comment on attachment 8919053 [details] [diff] [review]
Add an nsTArray::ContainsSorted method

Review of attachment 8919053 [details] [diff] [review]:
-----------------------------------------------------------------

That we can replace code with this new method is a good indication that we should have it!
Attachment #8919053 - Flags: review?(nfroyd) → review+
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/f3fcdeba5f88
Add an nsTArray::ContainsSorted method.  r=froydnj
https://hg.mozilla.org/mozilla-central/rev/f3fcdeba5f88
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.