mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 05:56:03 +01:00
replace more std::unordered_* types by faster boost hash maps
This commit is contained in:
parent
4f8c50fb77
commit
9f2b6a1b94
17 changed files with 75 additions and 71 deletions
|
|
@ -1,5 +1,4 @@
|
|||
#include <limits>
|
||||
#include <unordered_set>
|
||||
#include <sstream>
|
||||
|
||||
#include "nix/expr/print.hh"
|
||||
|
|
@ -10,6 +9,8 @@
|
|||
#include "nix/util/english.hh"
|
||||
#include "nix/expr/eval.hh"
|
||||
|
||||
#include <boost/unordered/unordered_flat_set.hpp>
|
||||
|
||||
namespace nix {
|
||||
|
||||
void printElided(
|
||||
|
|
@ -81,7 +82,7 @@ std::ostream & printLiteralBool(std::ostream & str, bool boolean)
|
|||
// For example `or' doesn't need to be quoted.
|
||||
bool isReservedKeyword(const std::string_view str)
|
||||
{
|
||||
static const std::unordered_set<std::string_view> reservedKeywords = {
|
||||
static const boost::unordered_flat_set<std::string_view> reservedKeywords = {
|
||||
"if", "then", "else", "assert", "with", "let", "in", "rec", "inherit"};
|
||||
return reservedKeywords.contains(str);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue