Skip to content

Commit 418ae33

Browse files
committed
feat: use-weakest-priority-constant
1 parent 7188b95 commit 418ae33

File tree

1 file changed

+2
-2
lines changed
  • lib/flagsmith/engine/evaluation

1 file changed

+2
-2
lines changed

lib/flagsmith/engine/evaluation/core.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def evaluate_feature_value(feature, identity_key = nil)
116116
# Returns {value: any; reason?: string}
117117
def get_multivariate_feature_value(feature, identity_key)
118118
percentage_value = hashed_percentage_for_object_ids([feature[:key], identity_key])
119-
sorted_variants = (feature[:variants] || []).sort_by { |v| v[:priority] || Float::INFINITY }
119+
sorted_variants = (feature[:variants] || []).sort_by { |v| v[:priority] || WEAKEST_PRIORITY }
120120

121121
start_percentage = 0
122122
sorted_variants.each do |variant|
@@ -154,7 +154,7 @@ def get_identity_key(evaluation_context)
154154

155155
# returns boolean
156156
def is_stronger_priority?(priority_a, priority_b)
157-
(priority_a || Float::INFINITY) < (priority_b || Float::INFINITY)
157+
(priority_a || WEAKEST_PRIORITY) < (priority_b || WEAKEST_PRIORITY)
158158
end
159159

160160
def get_targeting_match_reason(match_object)

0 commit comments

Comments
 (0)