aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2021-11-18 12:12:31 +0100
committerEelco Dolstra <edolstra@gmail.com>2021-11-18 12:12:31 +0100
commit262a3c7ce332d8f7f52b007178c2d54f063d6c7a (patch)
tree4532d644ca5e3f7d00f80e2730033cc297c4475b
parentacf381b061cd52abe737a306821bbb137bc132d7 (diff)
Simplify
-rw-r--r--src/libstore/references.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstore/references.cc b/src/libstore/references.cc
index bb9590acb..91b3fc142 100644
--- a/src/libstore/references.cc
+++ b/src/libstore/references.cc
@@ -54,12 +54,12 @@ void RefScanSink::operator () (std::string_view data)
fragment, so search in the concatenation of the tail of the
previous fragment and the start of the current fragment. */
auto s = tail;
- s.append(data.data(), std::min(data.size(), refLength));
+ auto tailLen = std::min(data.size(), refLength);
+ s.append(data.data(), tailLen);
search(s, hashes, seen);
search(data, hashes, seen);
- auto tailLen = std::min(data.size(), refLength);
auto rest = refLength - tailLen;
if (rest < tail.size())
tail = tail.substr(tail.size() - rest);