shithub: mc

Download patch

ref: 968a619a87998e26aca1498e42a296d1e9d5a5e7
parent: 9843a5b94825613f79356ece3c01918e439980fa
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:
 			->