Skip to content

Commit da3003a

Browse files
CaedenPHcclauss
andauthored
Update strings/palindrome.py
Co-authored-by: Christian Clauss <[email protected]>
1 parent 4454f58 commit da3003a

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Diff for: strings/palindrome.py

+2-6
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,9 @@ def is_palindrome_slice(s: str) -> bool:
8080

8181

8282
def benchmark_function(name: str) -> None:
83+
stmt = f"all({name}(key) is value for key, value in test_data.items())"
8384
setup = f"from __main__ import test_data, {name}"
84-
number = 100000
85-
res = timeit(
86-
f"all({name}(key) is value for key, value in test_data.items())",
87-
setup=setup,
88-
number=number,
89-
)
85+
res = timeit(stmt=stmt, setup=setup, number=100000)
9086
print(f"{name:<35} finished {number} runs in {res:.5f} seconds")
9187

9288

0 commit comments

Comments
 (0)