From ccfc7614a72644bfb85138901330a0bf516c4cdd Mon Sep 17 00:00:00 2001 From: gmega Date: Wed, 27 Nov 2024 11:36:17 -0300 Subject: [PATCH] another fix to shuffle --- benchmarks/core/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmarks/core/utils.py b/benchmarks/core/utils.py index ab12f10..02e7673 100644 --- a/benchmarks/core/utils.py +++ b/benchmarks/core/utils.py @@ -63,7 +63,7 @@ def sample(n: int) -> Iterator[int]: """Samples without replacement using a basic Fisher-Yates shuffle.""" p = list(range(0, n)) for i in range(n - 1): - j = i + random.randint(0, n - i) + j = random.randint(i, n - 1) tmp = p[j] p[j] = p[i] p[i] = tmp