www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8829] New: std.algorithm.find fails to take advantage of SortedRange


           Summary: std.algorithm.find fails to take advantage of
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: jmdavisProg gmx.com

--- Comment #0 from Jonathan M Davis <jmdavisProg gmx.com> 2012-10-15 22:18:53
PDT ---
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

Similarly, canFind should be able to use SortedRange's contains function.

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 15 2012