Skip to content

Commit

Permalink
Fix flappy tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Apr 11, 2024
1 parent 4f52c24 commit f6d31e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/credo/check/consistency/collector.ex
Expand Up @@ -183,7 +183,7 @@ defmodule Credo.Check.Consistency.Collector do
end

defp most_frequent_match(frequencies, supress_issues_for_single_match?, nil) do
{value, frequency_of_match} = Enum.max_by(frequencies, &elem(&1, 1))
{value, frequency_of_match} = frequencies |> Enum.sort() |> Enum.max_by(&elem(&1, 1))
single_match? = frequency_of_match == 1

if single_match? && supress_issues_for_single_match? do
Expand Down

0 comments on commit f6d31e1

Please sign in to comment.