Skip to content

Commit ee161c1

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 29db319 commit ee161c1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

strings/split.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ def split(string: str, separator: str = " ") -> list:
2121

2222
split_words = []
2323
last_index = 0
24-
24+
2525
# Single-pass scan using string slicing for optimal memory and speed
2626
for index, char in enumerate(string):
2727
if char == separator:
2828
split_words.append(string[last_index:index])
2929
last_index = index + 1
30-
30+
3131
# Append the remaining trailing substring after the last separator
3232
split_words.append(string[last_index:])
33-
33+
3434
return split_words
3535

3636

0 commit comments

Comments
 (0)