aboutsummaryrefslogtreecommitdiff
path: root/src/nix/main.cc
diff options
context:
space:
mode:
authorpiegames <git@piegames.de>2024-08-18 14:43:12 +0200
committerpiegames <git@piegames.de>2024-08-18 16:56:49 +0000
commit007211e7a27a512cb343060e8b363c9f66ef67af (patch)
treef5d127d61e182049e2c1534d1ded45bc2ef265f3 /src/nix/main.cc
parent7506d680ac540f39944c2a9f573900c5b1e4a023 (diff)
libutil: Optimize feature checks
Instead of doing a linear search on an std::set, we use a bitset enum. Change-Id: Ide537f6cffdd16d06e59aaeb2e4ac0acb6493421
Diffstat (limited to 'src/nix/main.cc')
-rw-r--r--src/nix/main.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nix/main.cc b/src/nix/main.cc
index 5356a0d04..e84e4f310 100644
--- a/src/nix/main.cc
+++ b/src/nix/main.cc
@@ -378,11 +378,10 @@ void mainWrapped(int argc, char * * argv)
}
if (argc == 2 && std::string(argv[1]) == "__dump-language") {
- experimentalFeatureSettings.experimentalFeatures = {
- Xp::Flakes,
- Xp::FetchClosure,
- Xp::DynamicDerivations,
- };
+ experimentalFeatureSettings.experimentalFeatures = ExperimentalFeatures{}
+ | Xp::Flakes
+ | Xp::FetchClosure
+ | Xp::DynamicDerivations;
evalSettings.pureEval = false;
EvalState state({}, openStore("dummy://"));
auto res = nlohmann::json::object();