[Issue 18280] 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
Wed Jan 24 18:05:29 UTC 2018


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

--- Comment #1 from github-bugzilla at puremagic.com ---
Commits pushed to master at https://github.com/dlang/phobos

https://github.com/dlang/phobos/commit/7f59e5ad526ee4bf856e8235e3042bb5cd442ad4
Fix Issue 18280 - std.algorithm.comparison.cmp for non-strings should call
opCmp only once per item pair

split cmp into two overloads per @andralex

https://github.com/dlang/phobos/pull/6056#pullrequestreview-90687092

Minor adjustments, again

cmp should return auto and let opCmp drive

https://github.com/dlang/phobos/pull/6056#issuecomment-359665184

Fix Issue 18285 - std.algorithm.comparison.cmp for strings with custom
predicate compares lengths wrong

Test std.algorithm.comparison.cmp when opCmp returns float

Promotions should not use cast

Optimize cmp's endgame

There are some redundant tests when the end of the ranges is reached.
Eliminated that, and improved threeWayByPred.

Fix Issue 18286 - std.algorithm.comparison.cmp for string with custom predicate
fails if distinct chars can compare equal

Fix Issue 18288 - std.algorithm.comparison.cmp for wide strings should be @safe

re-apply remove cast in promotions

https://github.com/dlang/phobos/commit/2174695151633e64c33ef8c73dcd98ae2c27606e
Merge pull request #6056 from n8sh/algorithm-cmp

Fix Issue 18280 - std.algorithm.comparison.cmp for non-strings should call
opCmp only once per item pair

--


More information about the Digitalmars-d-bugs mailing list