aboutsummaryrefslogtreecommitdiff
path: root/src/feature/syncinfo.nim
diff options
context:
space:
mode:
authorBenjamin Shirley-Quirk2020-08-04 20:36:19 +0000
committerBenjamin Shirley-Quirk2020-08-04 20:36:19 +0000
commit0afaa2a8cd7e56f4eabcf6b54e83bcab6be39f42 (patch)
treef474af5f8864f191eb006f3cf69e9c65490fb2cb /src/feature/syncinfo.nim
parent8c75dc9df518579cab48a6ded803bf8d493a3cab (diff)
compiles now on current devel (1.3.5)
Diffstat (limited to 'src/feature/syncinfo.nim')
-rw-r--r--src/feature/syncinfo.nim13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/feature/syncinfo.nim b/src/feature/syncinfo.nim
index 4f758fe..9dd1331 100644
--- a/src/feature/syncinfo.nim
+++ b/src/feature/syncinfo.nim
@@ -131,7 +131,14 @@ proc handleSyncInfo*(args: seq[Argument], config: Config): int =
let padding = pacmanInfoStrings.map(s => s.trp).computeMaxLength
let pkgInfosTable = pkgInfos.map(i => (i.rpc.toPackageReference, i)).toTable
- let codes = code & lc[handleTarget(config, padding, finalArgs, x,
- x.rpcInfo.map(i => pkgInfosTable.opt(i.toPackageReference)).flatten) |
- (x <- fullTargets), int]
+ when NimVersion >= "1.2":
+ let codes = block:
+ let tmp = collect(newSeq):
+ for x in fullTargets:
+ handleTarget(config, padding, finalArgs, x, x.rpcInfo.map(i => pkgInfosTable.opt(i.toPackageReference)).flatten)
+ code & tmp
+ else:
+ let codes = code & lc[handleTarget(config, padding, finalArgs, x,
+ x.rpcInfo.map(i => pkgInfosTable.opt(i.toPackageReference)).flatten) |
+ (x <- fullTargets), int]
codes.filter(c => c != 0).optFirst.get(0)