Merge pull request #9049 from inclyc/users/inclyc/move-path

libexpr: construct ExprPath by move ctor, not copy cotr
This commit is contained in:
Robert Hensing 2023-09-27 22:30:44 +01:00 committed by GitHub
commit 16a6ea7249
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -520,7 +520,7 @@ path_start
/* add back in the trailing '/' to the first segment */
if ($1.p[$1.l-1] == '/' && $1.l > 1)
path += "/";
$$ = new ExprPath(path);
$$ = new ExprPath(std::move(path));
}
| HPATH {
if (evalSettings.pureEval) {
@ -530,7 +530,7 @@ path_start
);
}
Path path(getHome() + std::string($1.p + 1, $1.l - 1));
$$ = new ExprPath(path);
$$ = new ExprPath(std::move(path));
}
;