Skip to content

Commit ae23bc5

Browse files
committed
Optimize ScanIterator to avoid unnecessary copying
Previously each key/value read during iteration was getting duplicated 😮 (This doesn't strictly belong to the PR its included in, but it will greatly benefit the DB migration script.)
1 parent 53c78fd commit ae23bc5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/new_index/db.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ impl<'a> Iterator for ScanIterator<'a> {
3838
return None;
3939
}
4040
Some(DBRow {
41-
key: key.to_vec(),
42-
value: value.to_vec(),
41+
key: key.into_vec(),
42+
value: value.into_vec(),
4343
})
4444
}
4545
}

0 commit comments

Comments
 (0)