diff --git a/src/libstore/unix/build/local-derivation-goal.cc b/src/libstore/unix/build/local-derivation-goal.cc index ca6348d6f..859663b68 100644 --- a/src/libstore/unix/build/local-derivation-goal.cc +++ b/src/libstore/unix/build/local-derivation-goal.cc @@ -2992,15 +2992,10 @@ void LocalDerivationGoal::checkOutputs(const std::mappath); else { - std::string allOutputs; - for (auto & o : outputs) { - if (! allOutputs.empty()) - allOutputs.append(", "); - allOutputs.append(o.first); - } + std::string outputsListing = concatMapStringsSep(", ", outputs, [](auto & o) { return o.first; }); throw BuildError("derivation '%s' output check for '%s' contains an illegal reference specifier '%s'," " expected store path or output name (one of [%s])", - worker.store.printStorePath(drvPath), outputName, i, allOutputs); + worker.store.printStorePath(drvPath), outputName, i, outputsListing); } }