1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 05:26:02 +01:00

Simplify SymbolTable::create()

This commit is contained in:
Eelco Dolstra 2025-07-10 12:27:17 +02:00
parent 74a144ce98
commit ca9f2028b0
2 changed files with 2 additions and 14 deletions

View file

@ -220,19 +220,7 @@ public:
// Most symbols are looked up more than once, so we trade off insertion performance
// for lookup performance.
// FIXME: make this thread-safe.
return [&]<typename T>(T && key) -> Symbol {
if constexpr (requires { symbols.insert<T>(key); }) {
auto [it, _] = symbols.insert<T>(key);
return Symbol(*it);
} else {
auto it = symbols.find<T>(key);
if (it != symbols.end())
return Symbol(*it);
it = symbols.emplace(key).first;
return Symbol(*it);
}
}(SymbolStr::Key{store, s, stringAlloc});
return Symbol(*symbols.insert(SymbolStr::Key{store, s, stringAlloc}).first);
}
std::vector<SymbolStr> resolve(const std::vector<Symbol> & symbols) const

View file

@ -41,7 +41,7 @@ boost = dependency(
'boost',
modules : ['container', 'context'],
include_type: 'system',
version: '>=1.81.0'
version: '>=1.82.0'
)
# boost is a public dependency, but not a pkg-config dependency unfortunately, so we
# put in `deps_other`.