diff options
author | pennae <github@quasiparticle.net> | 2022-01-21 14:44:00 +0100 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2022-01-27 17:15:43 +0100 |
commit | 41d70a2fc8d243d8c83ecc1c9ba648b625957437 (patch) | |
tree | a85c0c1971926fd8cf645f4ccf13547e2576a677 /src/nix/prefetch.cc | |
parent | 0d7fae6a574ec1b6758a7e6d8e639145c1c465a9 (diff) |
return string_views from forceString*
once a string has been forced we already have dynamic storage allocated for it,
so we can easily reuse that storage instead of copying.
Diffstat (limited to 'src/nix/prefetch.cc')
-rw-r--r-- | src/nix/prefetch.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nix/prefetch.cc b/src/nix/prefetch.cc index 768d37595..669be0709 100644 --- a/src/nix/prefetch.cc +++ b/src/nix/prefetch.cc @@ -38,7 +38,7 @@ string resolveMirrorUrl(EvalState & state, string url) if (mirrorList->value->listSize() < 1) throw Error("mirror URL '%s' did not expand to anything", url); - auto mirror = state.forceString(*mirrorList->value->listElems()[0]); + string mirror(state.forceString(*mirrorList->value->listElems()[0])); return mirror + (hasSuffix(mirror, "/") ? "" : "/") + string(s, p + 1); } |