From 949a4d2cd96f7b0cc4f4388327c3184ca61244a0 Mon Sep 17 00:00:00 2001 From: tersec Date: Fri, 20 Jan 2023 15:15:24 +0000 Subject: [PATCH] revert ncli/ncli_common.nim changes; 19969 evidently wasn't backported to 1.6 --- ncli/ncli_common.nim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ncli/ncli_common.nim b/ncli/ncli_common.nim index e052ef95c2..a39ee85bf7 100644 --- a/ncli/ncli_common.nim +++ b/ncli/ncli_common.nim @@ -69,9 +69,10 @@ func matchFilenameUnaggregatedFiles(filename: string): bool = # epochNumberRegexStr & epochFileNameExtension filename.len == epochInfoFileNameDigitsCount + epochFileNameExtension.len and filename.endsWith(epochFileNameExtension) and - # TODO can't be used with JS backend: + # TODO should use toOpenArray, but # https://github.com/nim-lang/Nim/issues/15952 - allIt(filename.toOpenArray(0, epochInfoFileNameDigitsCount - 1), it.isDigit) + # https://github.com/nim-lang/Nim/issues/19969 + allIt(filename[0 ..< epochInfoFileNameDigitsCount], it.isDigit) static: for filename in [ @@ -95,9 +96,10 @@ func matchFilenameAggregatedFiles(filename: string): bool = # epochNumberRegexStr & "_" & epochNumberRegexStr & epochFileNameExtension filename.len == epochInfoFileNameDigitsCount * 2 + "_".len + epochFileNameExtension.len and filename.endsWith(epochFileNameExtension) and - # TODO can't be used with JS backend: + # TODO should use toOpenArray, but # https://github.com/nim-lang/Nim/issues/15952 - allIt(filename.toOpenArray(0, epochInfoFileNameDigitsCount - 1), it.isDigit) and + # https://github.com/nim-lang/Nim/issues/19969 + allIt(filename[0 ..< epochInfoFileNameDigitsCount], it.isDigit) and filename[epochInfoFileNameDigitsCount] == '_' and allIt( filename[epochInfoFileNameDigitsCount + 1 ..< 2 * epochInfoFileNameDigitsCount + 1],