D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 11667 - std.algorithm.find() should take advantage of SortedRange
Summary: std.algorithm.find() should take advantage of SortedRange
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-03 00:58 UTC by Andrea Fontana
Modified: 2016-12-26 06:29 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrea Fontana 2013-12-03 00:58:07 UTC
When used with a SortedRange, std.algorithm.find() should search an item using a binary search in O(log(n)). Now it performs a O(n) scan.

Maybe it could use lowerbound() function inside std.range.
Comment 2 Seb 2016-12-26 06:25:42 UTC
this has been addressed in: https://github.com/dlang/phobos/pull/4907
Comment 3 Seb 2016-12-26 06:29:55 UTC
FYI: I opened an issue for addressing more functions: https://issues.dlang.org/show_bug.cgi?id=17030