mirror of
https://github.com/wting/autojump
synced 2024-10-27 20:34:07 +00:00
Use ternary.
This commit is contained in:
parent
3c658dc64f
commit
896b1c8562
@ -272,11 +272,8 @@ def match_consecutive(needles, haystack, ignore_case=False):
|
|||||||
(path="/moo/foo/baz", weight=10),
|
(path="/moo/foo/baz", weight=10),
|
||||||
(path="/foo/baz", weight=10)]
|
(path="/foo/baz", weight=10)]
|
||||||
"""
|
"""
|
||||||
if is_windows():
|
|
||||||
# The normal \\ separator needs to be escaped again for use in regex.
|
# The normal \\ separator needs to be escaped again for use in regex.
|
||||||
sep = '\\\\'
|
sep = '\\\\' if is_windows() else os.sep
|
||||||
else:
|
|
||||||
sep = os.sep
|
|
||||||
regex_no_sep = '[^' + sep + ']*'
|
regex_no_sep = '[^' + sep + ']*'
|
||||||
regex_no_sep_end = regex_no_sep + '$'
|
regex_no_sep_end = regex_no_sep + '$'
|
||||||
regex_one_sep = regex_no_sep + sep + regex_no_sep
|
regex_one_sep = regex_no_sep + sep + regex_no_sep
|
||||||
|
Loading…
Reference in New Issue
Block a user