aboutsummaryrefslogtreecommitdiff
path: root/src/pacman.nim
diff options
context:
space:
mode:
authorBenjamin Shirley-Quirk2020-08-04 22:45:21 +0000
committerBenjamin Shirley-Quirk2020-08-04 22:45:21 +0000
commitc54e6d24b70f21293612449c7a960e64077c5f89 (patch)
tree68d3b8bc1b7aacd2f622ceedb240be9e99300b82 /src/pacman.nim
parentb8d35dea8fb61ec177ab898b70404338f2ed477b (diff)
refactored collect blocks
Diffstat (limited to 'src/pacman.nim')
-rw-r--r--src/pacman.nim8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/pacman.nim b/src/pacman.nim
index 1b9d2f9..f9fc978 100644
--- a/src/pacman.nim
+++ b/src/pacman.nim
@@ -301,15 +301,15 @@ proc checkConflicts*(args: seq[Argument],
template full(s: string): OptionPair = table[s][0]
when NimVersion >= "1.3.5":
- (block:collect(newSeq):
+ optFirst:
+ collect(newSeq):
for c in conflicts:
if args.check(c.left.full):
for w in c.right:
if args.check(w.full):
(c.left,w)
- ).optFirst
elif NimVersion >= "1.2":
- (block:
+ optFirst:
var tmp = newSeq[(string,string)]()
for c in conflicts:
if args.check(c.left.full):
@@ -317,8 +317,6 @@ proc checkConflicts*(args: seq[Argument],
if args.check(w.full):
tmp.add((c.left,w))
tmp
- ).optFirst
-
else:
lc[(c.left, w) | (c <- conflicts, args.check(c.left.full),
w <- c.right, args.check(w.full)), (string, string)].optFirst