Skip to content

Commit ebbb8a0

Browse files
committed
Avoid having to count rows
1 parent 76ddeab commit ebbb8a0

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/database.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,6 @@ fn get_initial_data_from_db(
103103
);
104104
pb.enable_steady_tick(100);
105105

106-
let mut num_rows = 0;
107106
while let Some(row) = rows.next().unwrap() {
108107
let entry = state_group_map.entry(row.get(0)).or_default();
109108

@@ -118,10 +117,9 @@ fn get_initial_data_from_db(
118117
}
119118

120119
pb.inc(1);
121-
num_rows += 1;
122120
}
123121

124-
pb.set_length(num_rows);
122+
pb.set_length(pb.position());
125123
pb.finish();
126124

127125
state_group_map

0 commit comments

Comments
 (0)