Archived
0

fix compute СС if population is 0

This commit is contained in:
iMoHax
2016-12-07 14:13:39 +03:00
parent c96f8d320b
commit f2957d06ba

View File

@@ -109,7 +109,9 @@ public interface Place extends Connectable<Place> {
}
default long computeCC(){
return Math.round(Math.log10(getPopulation())+1);
long population = getPopulation();
if (population <= 0) return 0;
return Math.round(Math.log10(population)+1);
}
}