Skip to content

Commit 8649eaa

Browse files
committed
chore: address review comment - #686 (comment)
1 parent 259991e commit 8649eaa

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

remoteconfig/condition_evaluator.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@ func (ce *conditionEvaluator) evaluatePercentCondition(percentCondition *percent
148148
}
149149

150150
func computeInstanceMicroPercentile(seed string, randomizationID string) uint32 {
151-
seedPrefix := ""
151+
var sb strings.Builder
152152
if len(seed) > 0 {
153-
seedPrefix = fmt.Sprintf("%s.", seed)
153+
sb.WriteString(seed)
154+
sb.WriteRune('.')
154155
}
155-
stringToHash := fmt.Sprintf("%s%s", seedPrefix, randomizationID)
156+
sb.WriteString(randomizationID)
157+
stringToHash := sb.String()
156158

157159
hash := sha256.New()
158160
hash.Write([]byte(stringToHash))

0 commit comments

Comments
 (0)