whoops and small refactoring
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Alex 2022-07-08 10:16:46 +02:00
parent 4cc9a648ab
commit 4312623930
Signed by: lx
GPG key ID: 0E496D15096376BE

View file

@ -415,11 +415,6 @@ impl BlockStoreIterator {
ReadingDir::Pending(_) => unreachable!(),
};
if *pos >= subpaths.len() {
self.path.pop();
continue;
}
let data_dir_ent = match subpaths.get(*pos) {
None => {
self.path.pop();
@ -444,15 +439,12 @@ impl BlockStoreIterator {
let path = data_dir_ent.path();
self.path.push(ReadingDir::Pending(path));
} else if name.len() == 64 {
let hash_bytes = if let Ok(h) = hex::decode(&name) {
h
} else {
continue;
};
if let Ok(h) = hex::decode(&name) {
let mut hash = [0u8; 32];
hash.copy_from_slice(&hash_bytes[..]);
hash.copy_from_slice(&h);
return Ok(Some(hash.into()));
}
}
}
}
}