Closed Bug 1409152 Opened 7 years ago Closed 7 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
normal

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file)

Because binary search is better than linear search.
Attachment #8919053 - Flags: review?(nfroyd)
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: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: