diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2022-04-26 14:16:20 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2022-04-26 14:16:20 +0200 |
commit | b12c33510cb09f7d8300d7f3c762a84b8688780f (patch) | |
tree | c4fac991aca18a2d24c7888d666a3f005d4b2ad1 /src/libexpr/symbol-table.hh | |
parent | 474695975dde60f582ca0b2fb72c17f664e22876 (diff) |
EvalCache AttrKey: Use Symbol instead of std::string
Diffstat (limited to 'src/libexpr/symbol-table.hh')
-rw-r--r-- | src/libexpr/symbol-table.hh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libexpr/symbol-table.hh b/src/libexpr/symbol-table.hh index 63fb25d73..288c15602 100644 --- a/src/libexpr/symbol-table.hh +++ b/src/libexpr/symbol-table.hh @@ -72,12 +72,14 @@ private: ChunkedVector<std::string, 8192> store{16}; public: + Symbol create(std::string_view s) { // Most symbols are looked up more than once, so we trade off insertion performance // for lookup performance. // TODO: could probably be done more efficiently with transparent Hash and Equals // on the original implementation using unordered_set + // FIXME: make this thread-safe. auto it = symbols.find(s); if (it != symbols.end()) return Symbol(it->second.second + 1); |