summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2014-08-12 19:45:15 -0400
committerOri Bernstein <ori@eigenstate.org>2014-08-12 19:45:15 -0400
commitde4e4e086705df3cf6ea86e92151aff077a8e768 (patch)
tree769729be99011d0548d0b80b7ee665759321baec
parente00ae763296851dd3f011884f4b70a0070877bce (diff)
downloadmc-de4e4e086705df3cf6ea86e92151aff077a8e768.tar.gz
Reduce nesting levels in resolver.
-rw-r--r--libstd/resolve.myr17
1 files changed, 9 insertions, 8 deletions
diff --git a/libstd/resolve.myr b/libstd/resolve.myr
index db5785b..ea9ed21 100644
--- a/libstd/resolve.myr
+++ b/libstd/resolve.myr
@@ -141,15 +141,16 @@ const addhosts = {addr, as, str
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:
->