-
-
Notifications
You must be signed in to change notification settings - Fork 706
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
Simplify overlap #4201
Simplify overlap #4201
Conversation
|
removing inout doesn't require using std.algorithm.max/min instead of internal versions. See same thread. Edit: said that backwards. Using std.algorithm.min/max doesn't require removing inout. |
| static U* max(U* a, U* b) nothrow { return a > b ? a : b; } | ||
| static U* min(U* a, U* b) nothrow { return a < b ? a : b; } | ||
|
|
||
| import std.algorithm : min, max; |
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.
please add more detailed import
4e97a2a to
0fa6a50
Compare
|
@9il good point - done |
|
LGTM |
From the discussion
Btw did anyone already point out that with |
|
I don't want to say that this is extremely important to keep the way it is: we can remove inout from this function, and we pretty much gain nothing and lose compiler protection from mutation, but it's not super-harmful in this instance. I just think this is kind of a waste of time to make this minor change. If we are getting rid of inout, that decision hasn't been publicly announced, and we should at least wait until the path forward for those who depend on it is sorted.
You can change the inout version to return auto. Again, no need to remove inout. |
|
We're killing |
@quickfur Andrei really wants to. See http://forum.dlang.org/thread/nepm2k$311l$1@digitalmars.com http://forum.dlang.org/thread/ner843$2cag$1@digitalmars.com and http://forum.dlang.org/post/n25qkc$2il8$1@digitalmars.com |
|
I think this should be closed, due to the fact that the inout issue has been pretty much dropped. |
+1 |
|
This simplifies code regardless of |
|
@andralex The min, max changes are good, but I'm against the change of signature. |
|
Can we separate the removal of |
|
We are spending to much efforts for this PR |
|
Auto-merge toggled on |
|
@9il well put thanks |
Related: http://forum.dlang.org/post/ner843$2cag$1@digitalmars.com but this is an improvement regardless of one's opinion of
inout.