lib/encoding/base64: clear() via array-decay now that #258 lands; drop stale comment

This commit is contained in:
2026-06-02 06:17:59 +09:00
parent 16b7412003
commit 6d8434002d

View File

@@ -246,16 +246,10 @@ fn encode_closer(s: io.stream) (void | io.error) = {
};
// clear — zero the work buffers after a flush.
// ref/hare/encoding/base64/base64.ha:244-247. Hare passes the bare
// arrays (`bytes::zero(e.ibuf)`) which array-decay to a WHOLE-array
// slice — a hygiene wipe of every byte. ww has no implicit [N]T->[]T
// coercion yet (#258), so the slices are spelled EXPLICIT and
// FULL-LENGTH (`[0:len(...)]`, length via len() per rule-13) to
// preserve Hare's whole-array wipe; a windowed slice would leave stale
// tail bytes (a behavioral divergence).
// ref/hare/encoding/base64/base64.ha:244-247.
fn clear(e: *encoder) void = {
bytes.zero(e.ibuf[0 : len(e.ibuf)]);
bytes.zero(e.obuf[0 : len(e.obuf)]);
bytes.zero(e.ibuf);
bytes.zero(e.obuf);
};
// encodeslice — encode `in` and return a fresh byte slice of base64