Skip to content

Commit

Permalink
Expand guard clause into if-else statement for clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
Zapiano committed Nov 26, 2024
1 parent a7d946f commit 90a452b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/analysis/rule_extraction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,11 @@ function _remove_duplicates(
subclauses = join.([_strip_value.(r.condition) for r in rules], "_&_")
unique_subclauses = unique(subclauses)

# Return rules if there are no duplicate rules
# Check if there are duplicate rules before moving on
n_unique_rules = length(unique_subclauses)
(n_unique_rules == length(rules)) && return rules
if n_unique_rules == length(rules)
return rules
end

n_rules = length(rules)
n_duplicates = n_rules - n_unique_rules
Expand Down

0 comments on commit 90a452b

Please sign in to comment.