]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-116576: Fix `Tools/scripts/sortperf.py` sorting the same list (#116577)
authorNikita Sobolev <mail@sobolevn.me>
Mon, 11 Mar 2024 06:38:04 +0000 (09:38 +0300)
committerGitHub <noreply@github.com>
Mon, 11 Mar 2024 06:38:04 +0000 (09:38 +0300)
Tools/scripts/sortperf.py

index b54681524ac1731d1464f1dd43b57dcf3cc33805..1978a6c83dbe2b360fca56aaf5d26c1a621a2f4c 100644 (file)
@@ -130,7 +130,8 @@ class Benchmark:
 
     def _prepare_data(self, loops: int) -> list[float]:
         bench = BENCHMARKS[self._name]
-        return [bench(self._size, self._random)] * loops
+        data = bench(self._size, self._random)
+        return [data.copy() for _ in range(loops)]
 
 
 def add_cmdline_args(cmd: list[str], args) -> None: