diff options
| author | DMyachin | 2026-01-04 22:09:46 +0300 |
|---|---|---|
| committer | rfjakob | 2026-04-26 17:49:40 +0200 |
| commit | a991be3da536b2d57e5b481f0657c3651ea22194 (patch) | |
| tree | 0946ae6e3c036a4625f2027f7bfe0723a4056b2d | |
| parent | 501d5a507ec990536edc110ce21057022e604999 (diff) | |
use maps and slices instead of explicit for loop
| -rw-r--r-- | internal/configfile/feature_flags.go | 11 |
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) } |
