Skip to content
Myr

Optimize `split_arg_string` with `extend(...)` instead of a for loop system. (#3627)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Rowlando13 · committed by GitHub · parents 8a1b1a3, c4a6b57 · Browse files · 1 file+2 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−3 removed

  • other:+2 added−3 removed

1 file+2 added−3 removed

modified:src/click/shell_completion.py+2 added-3 removed
500 unmodified lines
501502 lex = shlex.shlex(string, posix=True)503 lex.whitespace_split = True504 lex.commenters = ""505 out = []505 out = [] # type: list[str]506507 try:508 for token in lex:509 out.append(token)508 out.extend(lex)509 except ValueError:510 # Raised when end-of-string is reached in an invalid state. Use511 # the partial token as-is. The quote or escape character is in512 # lex.state, not lex.token.
168 unmodified lines