mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +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 t = 0;
|
||||||
let mut f = File::open(path)?;
|
let mut f = File::open(path)?;
|
||||||
loop {
|
loop {
|
||||||
let mut b = vec![0; L];
|
let mut b = [0; L];
|
||||||
let l = f.read(&mut b)?;
|
if f.read(&mut b)? != L {
|
||||||
if l != L {
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if !info_hashes.iter().any(|i| i.0 == b[..l]) {
|
if !info_hashes.iter().any(|i| i.0 == b) {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
t += 1
|
t += 1
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue