Closed Shnatsel closed 5 years ago
Merging #34 into master will not change coverage. The diff coverage is
n/a
.
@@ Coverage Diff @@
## master #34 +/- ##
=======================================
Coverage 91.46% 91.46%
=======================================
Files 14 14
Lines 1301 1301
=======================================
Hits 1190 1190
Misses 111 111
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 691454e...5a7bcd1. Read the comment docs.
This could be write:
self.bit_reader
.as_inner_mut()
.take(len.into())
.read_to_end(&mut self.buffer)
.and_then(|used| {
if used != len.into() {
Err(io::Error::new(
io::ErrorKind::UnexpectedEof,
"Say something here",
))
} else {
Ok(())
}
})
This should be both safe and fast. I do not really follow you about your claim your PR is more fast, just with one test on your machine.
@Stargateur nice! Care to open a PR for that?
@Shnatsel Done
Fixes one occurrence of unsoundness described in #31
This change actually makes decoding 5% faster - as measured with hyperfine:
hyperfine -m 25 --warmup=3 'target/release/examples/flate -i enwiki-latest-all-titles-in-ns0.gz -o /dev/null gzip-decode'
On my machine the time goes down from 2.250s to 2.150s
Tests still pass.