ref: de4e4e086705df3cf6ea86e92151aff077a8e768
parent: e00ae763296851dd3f011884f4b70a0070877bce
author: Ori Bernstein <[email protected]>
date: Tue Aug 12 15:45:15 EDT 2014
Reduce nesting levels in resolver.
--- a/libstd/resolve.myr
+++ b/libstd/resolve.myr
@@ -141,15 +141,16 @@
while true
match word(str)
| `Some (name, rest):
- if !hthas(hostmap, name)
- hinf = [
- .fam=fam,
- .stype = 0,
- .ttl = 0,
- .addr = addr
- ]
- htput(hostmap, name, hinf)
+ if hthas(hostmap, name)
+ continue
;;
+ hinf = [
+ .fam=fam,
+ .stype = 0,
+ .ttl = 0,
+ .addr = addr
+ ]
+ htput(hostmap, name, hinf)
str = rest
| `None:
->