From 6d8434002dc02afbb0f14424fa3fa4620d38f1ba Mon Sep 17 00:00:00 2001 From: Hojun-Cho Date: Tue, 2 Jun 2026 06:17:59 +0900 Subject: [PATCH] lib/encoding/base64: clear() via array-decay now that #258 lands; drop stale comment --- lib/encoding/base64/base64.ww | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/encoding/base64/base64.ww b/lib/encoding/base64/base64.ww index 441ec8fb..44e5a3a5 100644 --- a/lib/encoding/base64/base64.ww +++ b/lib/encoding/base64/base64.ww @@ -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