-
-
Notifications
You must be signed in to change notification settings - Fork 702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds assert messages to std.algorithm.sorting #7091
Adds assert messages to std.algorithm.sorting #7091
Conversation
Thanks for your pull request, @burner! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + phobos#7091" |
std/algorithm/sorting.d
Outdated
@@ -617,7 +617,8 @@ size_t pivotPartition(alias less = "a < b", Range) | |||
(Range r, size_t pivot) | |||
if (isRandomAccessRange!Range && hasLength!Range && hasSlicing!Range && hasAssignableElements!Range) | |||
{ | |||
assert(pivot < r.length || r.length == 0 && pivot == 0); | |||
assert(pivot < r.length || r.length == 0 && pivot == 0, "pivot must be" | |||
~ " less then the length of r or r must be empty and pivot zero"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
less then
less th_a_n
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this always happens to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it isn't.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it helps to commit, my bad
std/algorithm/sorting.d
Outdated
@@ -1682,7 +1683,7 @@ private void shortSort(alias less, Range)(Range r) | |||
break; | |||
} | |||
|
|||
assert(r.length >= 6); | |||
assert(r.length >= 6, "r must be longer than 5"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r must have more than 5 elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
73bba90
to
8e0e2ca
Compare
review
8e0e2ca
to
dbf9d93
Compare
thanks, sorry for the noise |
@burner @thewilsonator please do not use
|
No description provided.