Skip to content

Commit ef5b38f

Browse files
committed
use enumerate when iterating to track index and item
1 parent d1da1b2 commit ef5b38f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/new_index/fetch.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,8 @@ fn blkfiles_reader(blk_files: Vec<PathBuf>, xor_key: Option<[u8; 8]>) -> Fetcher
186186
Fetcher::from(
187187
chan.into_receiver(),
188188
spawn_thread("blkfiles_reader", move || {
189-
let mut count = 0;
190189
let blk_files_len = blk_files.len();
191-
for path in blk_files {
192-
count += 1;
190+
for (count, path) in blk_files.iter().enumerate() {
193191
info!("block file reading {:}/{:} {:.2}%",
194192
count,
195193
blk_files_len,

0 commit comments

Comments
 (0)