aboutsummaryrefslogtreecommitdiffstats
path: root/examples/dns.aup
diff options
context:
space:
mode:
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 {