perf: count > 0 can be anyMatch

This commit is contained in:
Breno A. 2024-06-09 09:42:06 -03:00
parent e4123f47d6
commit b7735295f1

View File

@ -57,7 +57,7 @@ public class KahnsSort {
} }
} }
if (degreeList.values().stream().filter(value -> value != 0).count() != 0) if (degreeList.values().stream().anyMatch(value -> value != 0))
return null; // Loop found return null; // Loop found
return orderedList; return orderedList;