mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-21 16:47:28 +01:00
Have writer1.slice take mark arguments.
This commit is contained in:
1 parent
fd5d44b3fc
commit
d5c8e20268
8 files changed
+59
-20
No files matched your search
@@ -108,12 +108,10 @@ pub func decoder.decode?(dst writer1, src reader1)() {
|
||||
var z status = try this.decode_blocks?(dst:in.dst, src:in.src)
|
||||
if z.is_suspension() {
|
||||
var m1 buf1_mark = in.dst.mark()
|
||||
// TODO: add some way to specify the bounds of the slice.
|
||||
//
|
||||
// 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?
|
||||
var written[] u8 = in.dst.slice()
|
||||
var written[] u8 = in.dst.slice(m0:m0, m1:m1)
|
||||
if written.length() >= (32 * 1024) {
|
||||
written = written.suffix(up_to:32 * 1024)
|
||||
this.history[:].copy_from(s:written)
|
||||
|
||||
Reference in new issue
Block a user