Avoid having to count rows

This commit is contained in:
Jan Alexander Steffens (heftig)
2020-02-14 15:38:22 +01:00
parent 76ddeab12c
commit ebbb8a01bf
+1 -3
View File
@@ -103,7 +103,6 @@ fn get_initial_data_from_db(
);
pb.enable_steady_tick(100);
let mut num_rows = 0;
while let Some(row) = rows.next().unwrap() {
let entry = state_group_map.entry(row.get(0)).or_default();
@@ -118,10 +117,9 @@ fn get_initial_data_from_db(
}
pb.inc(1);
num_rows += 1;
}
pb.set_length(num_rows);
pb.set_length(pb.position());
pb.finish();
state_group_map