- Checking a list for empty is not needed for a "for" loop.

This commit is contained in:
Agetian
2017-07-21 12:35:22 +00:00
parent a9f8c3c4a6
commit cb82da915c

View File

@@ -65,11 +65,9 @@ public class Cost {
} }
public final boolean hasSpecificCostType(Class<? extends CostPart> costType) { public final boolean hasSpecificCostType(Class<? extends CostPart> costType) {
if (!getCostParts().isEmpty()) { for (CostPart p : getCostParts()) {
for (CostPart p : getCostParts()) { if (costType.isInstance(p)) {
if (costType.isInstance(p)) { return true;
return true;
}
} }
} }
return false; return false;