aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorDMyachin2026-01-04 22:09:46 +0300
committerrfjakob2026-04-26 17:49:40 +0200
commita991be3da536b2d57e5b481f0657c3651ea22194 (patch)
tree0946ae6e3c036a4625f2027f7bfe0723a4056b2d /internal
parent501d5a507ec990536edc110ce21057022e604999 (diff)
Update feature_flags.goHEADmaster
use maps and slices instead of explicit for loop
Diffstat (limited to 'internal')
-rw-r--r--internal/configfile/feature_flags.go11
1 files changed, 5 insertions, 6 deletions
diff --git a/internal/configfile/feature_flags.go b/internal/configfile/feature_flags.go
index d6627a5..d5bd6d4 100644
--- a/internal/configfile/feature_flags.go
+++ b/internal/configfile/feature_flags.go
@@ -1,5 +1,9 @@
package configfile
+import (
+ "slices"
+)
+
type flagIota int
const (
@@ -64,10 +68,5 @@ func isFeatureFlagKnown(flag string) bool {
// IsFeatureFlagSet returns true if the feature flag "flagWant" is enabled.
func (cf *ConfFile) IsFeatureFlagSet(flagWant flagIota) bool {
flagString := knownFlags[flagWant]
- for _, flag := range cf.FeatureFlags {
- if flag == flagString {
- return true
- }
- }
- return false
+ return slices.Contains(cf.FeatureFlags, flagString)
}