Skip to content

Commit 3da8d7f

Browse files
authored
Improving performance for array slice (#555)
* Addressing issue 552: #552 Improving performance for array slice * Removing unused import
1 parent e8426a4 commit 3da8d7f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

detect_secrets/util/code_snippet.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import itertools
21
from typing import Generator
32
from typing import List
43

@@ -27,7 +26,7 @@ def get_code_snippet(
2726
target_line_index = lines_of_context
2827

2928
return CodeSnippet(
30-
snippet=list(itertools.islice(lines, start_line_index, end_line_index)),
29+
snippet=lines[start_line_index:end_line_index],
3130
start_line=start_line_index,
3231
target_index=target_line_index,
3332
)

0 commit comments

Comments
 (0)