fix compute СС if population is 0
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user