Skip to content

Commit 32839c6

Browse files
anonrigmarco-ippolito
authored andcommitted
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 af226d0 commit 32839c6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/path.cc

Lines changed: 1 addition & 2 deletions
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)