1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 20:16:03 +01:00

Fix clang-tidy uninitialized value warning in derivation-options.cc

Make lambda capture explicit to avoid clang-analyzer-core.CallAndMessage warning
This commit is contained in:
Jörg Thalheim 2025-07-17 11:36:55 +02:00
parent 4ba3b15a10
commit 6bf940d636

View file

@ -138,7 +138,7 @@ DerivationOptions::fromStructuredAttrs(const StringMap & env, const StructuredAt
if (auto maxClosureSize = get(output, "maxClosureSize")) if (auto maxClosureSize = get(output, "maxClosureSize"))
checks.maxClosureSize = maxClosureSize->get<uint64_t>(); checks.maxClosureSize = maxClosureSize->get<uint64_t>();
auto get_ = [&](const std::string & name) -> std::optional<StringSet> { auto get_ = [&output = output](const std::string & name) -> std::optional<StringSet> {
if (auto i = get(output, name)) { if (auto i = get(output, name)) {
StringSet res; StringSet res;
for (auto j = i->begin(); j != i->end(); ++j) { for (auto j = i->begin(); j != i->end(); ++j) {