1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-05 12:21:48 +02:00

cont. cleanup: remove superfluous std::string copies

This commit is contained in:
Philipp Otterbein 2024-10-07 01:05:17 +02:00
parent 4c0c8e5428
commit caf3b55891
6 changed files with 21 additions and 17 deletions

View file

@ -293,7 +293,7 @@ void RootArgs::parseCmdline(const Strings & _cmdline, bool allowShebang)
// We match one space after `nix` so that we preserve indentation.
// No space is necessary for an empty line. An empty line has basically no effect.
if (std::regex_match(line, match, std::regex("^#!\\s*nix(:? |$)(.*)$")))
shebangContent += match[2].str() + "\n";
shebangContent += std::string_view{match[2].first, match[2].second} + "\n";
}
for (const auto & word : parseShebangContent(shebangContent)) {
cmdline.push_back(word);