Skip to content

Commit 0f35442

Browse files
committed
simplify
1 parent 28df4de commit 0f35442

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

tools/nimdigger.nim

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,11 @@ macro ctor(obj: untyped, a: varargs[untyped]): untyped =
142142

143143
proc parseKeyVal(a: string): OrderedTable[string, string] =
144144
## parse bash-like entries of the form key=val
145-
let a2 = a.splitLines
146-
for i, ai in a2:
145+
for ai in a.splitLines:
147146
if ai.len == 0 or ai.startsWith "#": continue
148-
let b = split(ai, "=", maxsplit = 1)
149-
doAssert b.len == 2, $(ai, b)
150-
result[b[0]] = b[1]
147+
let kv = split(ai, "=", maxsplit = 1)
148+
doAssert kv.len == 2, $(ai, kv)
149+
result[kv[0]] = kv[1]
151150

152151
# xxx move some of these to std/private/gitutils.nim
153152
proc gitClone(url: string, dir: string) = runCmd fmt"git clone -q {url.quoteShell} {dir.quoteShell}"

0 commit comments

Comments
 (0)