mirror of
https://github.com/NixOS/nix.git
synced 2025-11-12 13:36:02 +01:00
Simplify SymbolTable::create()
This commit is contained in:
parent
74a144ce98
commit
ca9f2028b0
2 changed files with 2 additions and 14 deletions
|
|
@ -220,19 +220,7 @@ public:
|
||||||
// Most symbols are looked up more than once, so we trade off insertion performance
|
// Most symbols are looked up more than once, so we trade off insertion performance
|
||||||
// for lookup performance.
|
// for lookup performance.
|
||||||
// FIXME: make this thread-safe.
|
// FIXME: make this thread-safe.
|
||||||
return [&]<typename T>(T && key) -> Symbol {
|
return Symbol(*symbols.insert(SymbolStr::Key{store, s, stringAlloc}).first);
|
||||||
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});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<SymbolStr> resolve(const std::vector<Symbol> & symbols) const
|
std::vector<SymbolStr> resolve(const std::vector<Symbol> & symbols) const
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ boost = dependency(
|
||||||
'boost',
|
'boost',
|
||||||
modules : ['container', 'context'],
|
modules : ['container', 'context'],
|
||||||
include_type: 'system',
|
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
|
# boost is a public dependency, but not a pkg-config dependency unfortunately, so we
|
||||||
# put in `deps_other`.
|
# put in `deps_other`.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue