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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 15 22:18:55 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=8829

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


--- Comment #0 from Jonathan M Davis <jmdavisProg at 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
predicate).

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: -------


More information about the Digitalmars-d-bugs mailing list