mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Rename writer1.slice to writer1.since_mark.
This commit is contained in:
1 parent
bdfe4abbd3
commit
5052b16f2d
7 files changed
+18
-23
No files matched your search
@@ -123,12 +123,10 @@ pub func flate_decoder.decode?(dst writer1, src reader1)() {
|
||||
// TODO: rename "return" to "raise"?
|
||||
return z
|
||||
}
|
||||
// TODO: should "slice" be "slice!", as the return value lets you
|
||||
// modify the state of in.dst, so future mutations (via the slice) can
|
||||
// change the veracity of any in.dst assertions?
|
||||
//
|
||||
// Should the RHS be "in.dst[:]" instead of a method call?
|
||||
var written[] u8 = in.dst.slice()
|
||||
// TODO: should "since_mark" be "since_mark!", as the return value lets
|
||||
// you modify the state of in.dst, so future mutations (via the slice)
|
||||
// can change the veracity of any in.dst assertions?
|
||||
var written[] u8 = in.dst.since_mark()
|
||||
// Append written, the decoded output, to the history ringbuffer.
|
||||
if written.length() >= 0x8000 {
|
||||
// If written is longer than the ringbuffer, we can ignore the
|
||||
|
||||
@@ -50,10 +50,7 @@ pub func zlib_decoder.decode?(dst writer1, src reader1)() {
|
||||
var z status = try this.flate.decode?(dst:in.dst, src:in.src)
|
||||
// TODO: expose some API to opt out of checksumming, trading off error
|
||||
// detection for throughput.
|
||||
//
|
||||
// TODO: in.dst.slice needs a previous mark statement. Do that, and
|
||||
// remove the b_wstart_dst derived variables.
|
||||
checksum = this.adler.update(x:in.dst.slice())
|
||||
checksum = this.adler.update(x:in.dst.since_mark())
|
||||
if z.is_ok() {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user