From cdd7e9279c334f962a415a28062da2a2300b2b0a Mon Sep 17 00:00:00 2001 From: Dimitri LESNOFF Date: Tue, 8 Oct 2024 11:30:45 +0200 Subject: [PATCH 1/2] Specify template's return type for correct variable declaration --- strings/check_anagram.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/check_anagram.nim b/strings/check_anagram.nim index 9a3ef7ba..d3dbdd19 100644 --- a/strings/check_anagram.nim +++ b/strings/check_anagram.nim @@ -59,7 +59,7 @@ func toLowerUnchecked(c: char): char {.inline.} = # 0b100_0001, so setting the sixth bit to 1 gives letter's lowercase pair. char(uint8(c) or 0b0010_0000'u8) -template normalizeChar(c: char) = +template normalizeChar(c: char): char = ## Checks if the character is a letter and lowers its case. ## ## Raises a `ValueError` on other characters. From 92581dd1700bfdda026d08868c53151b5163fa00 Mon Sep 17 00:00:00 2001 From: Dimitri LESNOFF Date: Tue, 8 Oct 2024 11:31:19 +0200 Subject: [PATCH 2/2] [modular_inverse] Reduce the number of tests to make CI readable again --- maths/modular_inverse.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maths/modular_inverse.nim b/maths/modular_inverse.nim index 4b9d0b87..234cb2ab 100644 --- a/maths/modular_inverse.nim +++ b/maths/modular_inverse.nim @@ -67,7 +67,7 @@ when isMainModule: check modularInverse(17, 17).is_none() randomize() - const randomTestSize = 1000 + const randomTestSize = 10 for testNum in 0..randomTestSize: let a = rand(-10000000..10000000) let modulus = rand(1..1000000)