Skip to content

Commit 4a2c6ff

Browse files
anonrigtargos
authored andcommittedJun 1, 2024
src: reduce unnecessary GetCwd calls
PR-URL: #53064 Reviewed-By: Richard Lau <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Rafael Gonzaga <[email protected]>
1 parent 7940db7 commit 4a2c6ff

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed
 

Diff for: ‎src/path.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,7 @@ std::string PathResolve(Environment* env,
240240
const size_t numArgs = paths.size();
241241

242242
for (int i = numArgs - 1; i >= -1 && !resolvedAbsolute; i--) {
243-
const std::string& path =
244-
(i >= 0) ? std::string(paths[i]) : env->GetCwd(env->exec_path());
243+
const std::string& path = (i >= 0) ? std::string(paths[i]) : cwd;
245244

246245
if (!path.empty()) {
247246
resolvedPath = std::string(path) + "/" + resolvedPath;

0 commit comments

Comments
 (0)
Please sign in to comment.