mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 16:02:23 -04:00
Avoid an extra allocation when extracting media checksums
This commit is contained in:
parent
c7c1cfac33
commit
c4ebbd719c
1 changed files with 1 additions and 1 deletions
|
@ -239,7 +239,7 @@ delete from media where fname=?"
|
||||||
|
|
||||||
fn row_to_entry(row: &Row) -> rusqlite::Result<MediaEntry> {
|
fn row_to_entry(row: &Row) -> rusqlite::Result<MediaEntry> {
|
||||||
// map the string checksum into bytes
|
// map the string checksum into bytes
|
||||||
let sha1_str: Option<String> = row.get(1)?;
|
let sha1_str = row.get_ref(1)?.as_str_or_null()?;
|
||||||
let sha1_array = if let Some(s) = sha1_str {
|
let sha1_array = if let Some(s) = sha1_str {
|
||||||
let mut arr = [0; 20];
|
let mut arr = [0; 20];
|
||||||
match hex::decode_to_slice(s, arr.as_mut()) {
|
match hex::decode_to_slice(s, arr.as_mut()) {
|
||||||
|
|
Loading…
Reference in a new issue