mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
minor optimizations: remove extra vector wrap
This commit is contained in:
parent
67de3fc213
commit
4ec82dc945
1 changed files with 3 additions and 4 deletions
|
|
@ -184,12 +184,11 @@ impl TorrentMaps {
|
|||
let mut t = 0;
|
||||
let mut f = File::open(path)?;
|
||||
loop {
|
||||
let mut b = vec![0; L];
|
||||
let l = f.read(&mut b)?;
|
||||
if l != L {
|
||||
let mut b = [0; L];
|
||||
if f.read(&mut b)? != L {
|
||||
break;
|
||||
}
|
||||
if !info_hashes.iter().any(|i| i.0 == b[..l]) {
|
||||
if !info_hashes.iter().any(|i| i.0 == b) {
|
||||
return Ok(false);
|
||||
}
|
||||
t += 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue