Rename variable nar -> dump according to TODO

This commit is contained in:
John Ericson 2020-07-14 21:28:50 +00:00
parent 8173e7bfef
commit 650c2c6558

View file

@ -1107,7 +1107,7 @@ StorePath LocalStore::addToStore(const string & name, const Path & _srcPath,
temporary path. Otherwise, we move it to the destination store temporary path. Otherwise, we move it to the destination store
path. */ path. */
bool inMemory = true; bool inMemory = true;
std::string nar; // TODO rename from "nar" to "dump" std::string dump;
auto source = sinkToSource([&](Sink & sink) { auto source = sinkToSource([&](Sink & sink) {
@ -1115,13 +1115,13 @@ StorePath LocalStore::addToStore(const string & name, const Path & _srcPath,
(*hashSink)(buf, len); (*hashSink)(buf, len);
if (inMemory) { if (inMemory) {
if (nar.size() + len > settings.narBufferSize) { if (dump.size() + len > settings.narBufferSize) {
inMemory = false; inMemory = false;
sink << 1; sink << 1;
sink((const unsigned char *) nar.data(), nar.size()); sink((const unsigned char *) dump.data(), dump.size());
nar.clear(); dump.clear();
} else { } else {
nar.append((const char *) buf, len); dump.append((const char *) buf, len);
} }
} }
@ -1180,7 +1180,7 @@ StorePath LocalStore::addToStore(const string & name, const Path & _srcPath,
if (inMemory) { if (inMemory) {
/* Restore from the NAR in memory. */ /* Restore from the NAR in memory. */
StringSource source(nar); StringSource source(dump);
if (method == FileIngestionMethod::Recursive) if (method == FileIngestionMethod::Recursive)
restorePath(realPath, source); restorePath(realPath, source);
else else