Avoid initializing drop state with known-bad values

This commit is contained in:
Erica Fischer
2023-07-17 16:39:36 -07:00
parent 81a4342189
commit eb3b57de8f
2 changed files with 5 additions and 5 deletions
-4
View File
@@ -64,10 +64,6 @@ int calc_feature_minzoom(struct index *ix, struct drop_state ds[], int maxzoom,
}
void prep_drop_states(struct drop_state ds[], int maxzoom, int basezoom, double droprate) {
if (basezoom < 0) {
basezoom = maxzoom;
}
// Needs to be signed for interval calculation
for (ssize_t i = 0; i <= maxzoom; i++) {
ds[i].previndex = 0;
+5 -1
View File
@@ -1056,7 +1056,11 @@ void radix(std::vector<struct reader> &readers, int nreaders, FILE *geomfile, FI
}
struct drop_state ds[maxzoom + 1];
prep_drop_states(ds, maxzoom, basezoom, droprate);
if (maxzoom < 0 || droprate <= 0) { // not guessed with -zg yet
prep_drop_states(ds, 0, 0, 1);
} else {
prep_drop_states(ds, maxzoom, basezoom, droprate);
}
long long progress = 0, progress_max = geom_total, progress_reported = -1;
long long availfiles_before = availfiles;