Bug 8829 – std.algorithm.find fails to take advantage of SortedRange

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-10-15T22:18:00Z
Last change time
2017-01-16T23:25:35Z
Keywords
bootcamp
Assigned to
razvan.nitu1305
Creator
issues.dlang

Comments

Comment #0 by issues.dlang — 2012-10-15T22:18:53Z
find should be able to take advantage of SortedRange at least some of the time. At minimum, the overload which takes a single element for the needle should use upperBound on SortedRange rather than searching through the range element by element. I don't know how often it can really take advantage of it, because it must be able to verify that the predicates are the same, but that should be feasible for at least the default predicate (and probably any string predicate). Similarly, canFind should be able to use SortedRange's contains function.
Comment #1 by github-bugzilla — 2016-12-06T22:57:16Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8b29f206ae8828cf5656881b16e725850c91b728 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/d6519853e1c603169d15c30a1f32aa7c557d6a9d Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/818d51200754ace7c766c6692a27d95c8e4eafc7 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/752b2ca210f8e6f1b7d1c3887f23c1e5a382a85d Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/e4b82503b8517d533271469797b4a3773ae38527 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/98a7c44aafb7e0547fb4b6845e0724597bc81b81 Merge pull request #4907 from RazvanN7/Issue_8828 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange
Comment #2 by github-bugzilla — 2017-01-07T03:02:56Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8b29f206ae8828cf5656881b16e725850c91b728 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/d6519853e1c603169d15c30a1f32aa7c557d6a9d Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/818d51200754ace7c766c6692a27d95c8e4eafc7 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/752b2ca210f8e6f1b7d1c3887f23c1e5a382a85d Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/e4b82503b8517d533271469797b4a3773ae38527 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/98a7c44aafb7e0547fb4b6845e0724597bc81b81 Merge pull request #4907 from RazvanN7/Issue_8828
Comment #3 by github-bugzilla — 2017-01-16T23:25:35Z
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/8b29f206ae8828cf5656881b16e725850c91b728 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/d6519853e1c603169d15c30a1f32aa7c557d6a9d Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/818d51200754ace7c766c6692a27d95c8e4eafc7 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/752b2ca210f8e6f1b7d1c3887f23c1e5a382a85d Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/e4b82503b8517d533271469797b4a3773ae38527 Issue 8829 - std.algorithm.find fails to take advantage of SortedRange https://github.com/dlang/phobos/commit/98a7c44aafb7e0547fb4b6845e0724597bc81b81 Merge pull request #4907 from RazvanN7/Issue_8828