[Issue 18280] New: std.algorithm.comparison.cmp for non-strings should call opCmp only once per item pair

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 22 23:27:26 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18280

          Issue ID: 18280
           Summary: std.algorithm.comparison.cmp for non-strings should
                    call opCmp only once per item pair
           Product: D
           Version: D2
          Hardware: All
               URL: http://dlang.org/
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: phobos
          Assignee: nobody at puremagic.com
          Reporter: n8sh.secondary at hotmail.com

Right now when comparing non-string ranges std.algorithm.comparison.cmp calls
the comparison predicate twice for every pair of elements to determine their
order. When the elements have overloaded `opCmp` and the predicate is "a < b"
we only need to call `opCmp` once for each pair.

--


More information about the Digitalmars-d-bugs mailing list