about summary refs log tree commit diff
path: root/src/libutil/hash.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2016-11-16T15·21+0100
committerEelco Dolstra <edolstra@gmail.com>2016-11-16T15·21+0100
commit4be4f6de56f4de77f6a376f1a40ed75eb641bb89 (patch)
treedbaa5c53f816f85cde44e0c89661b67a6a0a4b92 /src/libutil/hash.cc
parent10ae8fabf1e7e7bd8817b93560df7484c3bd18b8 (diff)
S3BinaryCacheStore:: Eliminate a string copy while uploading
This cuts hydra-queue-runner's peak memory usage by about a third.
Diffstat (limited to 'src/libutil/hash.cc')
-rw-r--r--src/libutil/hash.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 81aced0fde16..49e781980f3a 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -106,7 +106,7 @@ Hash parseHash(HashType ht, const string & s)
         string s2(s, i * 2, 2);
         if (!isxdigit(s2[0]) || !isxdigit(s2[1]))
             throw BadHash(format("invalid hash ‘%1%’") % s);
-        std::istringstream str(s2);
+        istringstream_nocopy str(s2);
         int n;
         str >> std::hex >> n;
         hash.hash[i] = n;