aboutsummaryrefslogtreecommitdiffstats
path: root/examples/dns.aup
diff options
context:
space:
mode:
authoreunhhu <[email protected]>2026-10-19 05:16:07 +0100
committereunhhu <[email protected]>2026-10-19 05:16:07 +0100
commit2222dc78a3a7220299fafddaae7d10cc486c61ac (patch)
treefa790c1ed63d778a6680c7feec83bef4a2350dcb /examples/dns.aup
parent096a70a7cd5a5785b1b52aa8512422b30f014c09 (diff)
downloadaup-2222dc78a3a7220299fafddaae7d10cc486c61ac.tar.gz
aup-2222dc78a3a7220299fafddaae7d10cc486c61ac.zip
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
Diffstat (limited to 'examples/dns.aup')
-rw-r--r--examples/dns.aup15
1 files changed, 3 insertions, 12 deletions
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 {