-
-
Notifications
You must be signed in to change notification settings - Fork 740
Do not call getcwd
(or other base
) in absolutePath
if not needed.
#522
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
Conversation
// TODO: @safe (BUG 6405) pure (because of buildPath()) | ||
{ | ||
if (path.empty) return null; | ||
if (isAbsolute(path)) return path; | ||
if (!isAbsolute(base)) throw new Exception("Base directory must be absolute"); | ||
return buildPath(base, path); | ||
immutable baseVar = base; |
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.
Why this line? Surely dmd has to be smart enough to only call getcwd the first time base is used?
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.
Nevermind, I see now that it is supposed to be evaluated on every use, by design.
Would it make sense to do the same for relativePath, while we're at it? |
Of course. Didn't notice that |
I don't think that's necessary. (Personally, I prefer making many small commits rather than a few big ones, as long as each commit leaves the code in a working state.) |
Hmm.. it seems there is a merge conflict, most likely due to a recent update I made to |
…ePath` if not needed.
Rebased.
I don't run any unittests because autotester made me lazy... |
Cool, I wouldn't have expected GitHub to handle a rebase so nicely. All right, I'll merge the pull request when it has passed through the autotester. |
Do not call `getcwd` (or other `base`) in `absolutePath` if not needed.
No description provided.