[Issue 10706] Functions that require a sorted range to take a SortedRange?

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 11 20:37:28 PDT 2015


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

Collin Reeser <collin.reeser at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |collin.reeser at gmail.com

--- Comment #1 from Collin Reeser <collin.reeser at gmail.com> ---
I was actually burned by this today. Coinciding with the release of 2.068
(though I didn't initially know the release was upon us!), Travis builds for my
project started inexplicably failing. The root cause was that a
setSymmetricDifference call, which had been working for many months, was
suddenly giving nonsense results.

One of the inputs to the call was a .keys() on an associative array.

Presumably, it just-so-happened that the .keys() was yielding sorted output,
but with the change to the internals of the associative arrays this release, it
just-so-happened that the .keys() result wasn't sorted! Since I misunderstood
the documentation of setSymmetricDifference to mean "is-sortable-by 'less'",
and not "must have been, prior to input, sorted by 'less'", I didn't initially
put the .sort() call after the .keys() call.

Too bad so sad. Figured it out, but lost some time to it.

--


More information about the Digitalmars-d-bugs mailing list