From afcf96444366fb4b7c83f938763013cbc360aade Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Fri, 13 Nov 2026 16:17:13 -0800 Subject: Array init syntax New array init syntax; used in a bunch of places. Allows e.g. read-only arrays with not-null entries. Fix bug x86 encoding of mem/cmp/fp compares --- chapter31/src/main/smp/sys/text.smp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'chapter31/src/main/smp/sys/text.smp') diff --git a/chapter31/src/main/smp/sys/text.smp b/chapter31/src/main/smp/sys/text.smp index a28edf6d..2c4b44ff 100644 --- a/chapter31/src/main/smp/sys/text.smp +++ b/chapter31/src/main/smp/sys/text.smp @@ -5,10 +5,7 @@ val begin = { -> new aryu8(); }; val end = { aryu8 b -> - val bytes = new u8[b.len]; - ary.copy(bytes,0,b.buf,0,b.len); - u8[~] result = bytes; - result; + new u8[~b.len]{ i64 i -> b.buf[i]; }; }; val _pad = { !aryu8 b, i64 n, u8 c -> -- cgit v1.2.3