From 2222dc78a3a7220299fafddaae7d10cc486c61ac Mon Sep 17 00:00:00 2001 From: eunhhu Date: Mon, 19 Oct 2026 05:16:07 +0100 Subject: The three spec apps without their workarounds (Pure 140 after its decision point): inflate's code takes a bare list and its output is a bytes state, its block's tables built in the handler (lets' lists in inner blocks), 132 lines to 121; DNS's compression compares a suffix with == (bytes compared), 115 to 106; HTTP's left bytes a bytes state, names and codings compared as bytes, its field lines returned as a bare list, 159 to 148 --- examples/dns.aup | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'examples/dns.aup') diff --git a/examples/dns.aup b/examples/dns.aup index fdc6722..8f7239a 100644 --- a/examples/dns.aup +++ b/examples/dns.aup @@ -100,18 +100,9 @@ view wire { let done = false while !done && r.name[k] != 0 { for s in seen { - if !done && s.name.bytes == r.name.bytes - k { - let same = true # bytes have no ==: compared a byte at a time - for b in 0 .. s.name.bytes { - if s.name[b] != r.name[k + b] { - same = false - break - } - } - if same { - out = out + two(49152 + s.at) # 0xc000: a pointer - done = true - } + if !done && s.name == r.name[k .. r.name.bytes] { + out = out + two(49152 + s.at) # 0xc000: a pointer + done = true } } if !done { -- cgit v1.2.3