Skip to content

Commit 4e4b60d

Browse files
fix(lint): linter issue with redifinition of max (#2669)
1 parent c033936 commit 4e4b60d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

internal/utils/hash.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ func Hash(s string) uint32 {
1414
}
1515

1616
// BuildHash is building the hash based on the different properties of the evaluation.
17-
func BuildHash(flagName string, bucketingKey string, max uint32) uint32 {
18-
// this is not supposed to happen, but to avoid a crash if max is 0 we are returning 0
19-
if max == uint32(0) {
17+
func BuildHash(flagName string, bucketingKey string, maxPercentage uint32) uint32 {
18+
// this is not supposed to happen, but to avoid a crash if maxPercentage is 0 we are returning 0
19+
if maxPercentage == uint32(0) {
2020
return uint32(0)
2121
}
22-
return Hash(flagName+bucketingKey) % max
22+
return Hash(flagName+bucketingKey) % maxPercentage
2323
}

0 commit comments

Comments
 (0)