Have writer1.slice take mark arguments.

This commit is contained in:
Nigel Tao committed 2017-09-23 13:57:48 +10:00
1 parent fd5d44b3fc
commit d5c8e20268
8 files changed
+59 -20

No files matched your search

+1 -3
View File
@@ -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)