diff options
author | piegames <git@piegames.de> | 2024-08-18 14:43:12 +0200 |
---|---|---|
committer | piegames <git@piegames.de> | 2024-08-18 16:56:49 +0000 |
commit | 007211e7a27a512cb343060e8b363c9f66ef67af (patch) | |
tree | f5d127d61e182049e2c1534d1ded45bc2ef265f3 /src/libutil/config.hh | |
parent | 7506d680ac540f39944c2a9f573900c5b1e4a023 (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/libutil/config.hh')
-rw-r--r-- | src/libutil/config.hh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libutil/config.hh b/src/libutil/config.hh index 36e42fe63..d1812f47e 100644 --- a/src/libutil/config.hh +++ b/src/libutil/config.hh @@ -444,7 +444,7 @@ extern GlobalConfig globalConfig; struct FeatureSettings : Config { - Setting<std::set<ExperimentalFeature>> experimentalFeatures{ + Setting<ExperimentalFeatures> experimentalFeatures{ this, {}, "experimental-features", R"( Experimental features that are enabled. @@ -484,8 +484,7 @@ struct FeatureSettings : Config { * disabled, and so the function does nothing in that case. */ void require(const std::optional<ExperimentalFeature> &) const; - - Setting<std::set<DeprecatedFeature>> deprecatedFeatures{ + Setting<DeprecatedFeatures> deprecatedFeatures{ this, {}, "deprecated-features", R"( Deprecated features that are allowed. |