From 262a3c7ce332d8f7f52b007178c2d54f063d6c7a Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 18 Nov 2021 12:12:31 +0100 Subject: [PATCH] Simplify --- src/libstore/references.cc | 4 ++-- 1 file 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);