1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 17:31:47 +02:00

Merge pull request #11682 from NaN-git/opt-str

Remove superfluous `std::string` copy operations
This commit is contained in:
Robert Hensing 2024-10-12 10:59:40 +02:00 committed by GitHub
commit 30c4f5eb51
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 72 additions and 54 deletions

View file

@ -66,7 +66,7 @@ static void prim_fromTOML(EvalState & state, const PosIdx pos, Value * * args, V
attrs.alloc("_type").mkString("timestamp");
std::ostringstream s;
s << t;
attrs.alloc("value").mkString(s.str());
attrs.alloc("value").mkString(toView(s));
v.mkAttrs(attrs);
} else {
throw std::runtime_error("Dates and times are not supported");