aboutsummaryrefslogtreecommitdiff
path: root/src/common.nim
diff options
context:
space:
mode:
Diffstat (limited to 'src/common.nim')
-rw-r--r--src/common.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common.nim b/src/common.nim
index 8dc41c8..0f2804b 100644
--- a/src/common.nim
+++ b/src/common.nim
@@ -154,13 +154,12 @@ proc findSyncTargets*(handle: ptr AlpmHandle, dbs: seq[ptr AlpmDatabase],
else:
if allowGroups and target.reference.constraint.isNone:
when NimVersion >= "1.2":
- let groupRepo = block:
- let tmp = collect(newSeq):
+ let groupRepo = optFirst:
+ collect(newSeq):
for d in dbs:
for g in d.groups:
if $g.name == target.reference.name:
d
- tmp.optFirst
else:
let groupRepo = lc[d | (d <- dbs, g <- d.groups,
$g.name == target.reference.name), ptr AlpmDatabase].optFirst