Explorar el Código

Use ternary.

pull/321/head
William Ting hace 10 años
padre
commit
896b1c8562
Se han modificado 1 ficheros con 2 adiciones y 5 borrados
  1. +2
    -5
      bin/autojump

+ 2
- 5
bin/autojump Ver fichero

@ -272,11 +272,8 @@ def match_consecutive(needles, haystack, ignore_case=False):
(path="/moo/foo/baz", weight=10),
(path="/foo/baz", weight=10)]
"""
if is_windows():
# The normal \\ separator needs to be escaped again for use in regex.
sep = '\\\\'
else:
sep = os.sep
# The normal \\ separator needs to be escaped again for use in regex.
sep = '\\\\' if is_windows() else os.sep
regex_no_sep = '[^' + sep + ']*'
regex_no_sep_end = regex_no_sep + '$'
regex_one_sep = regex_no_sep + sep + regex_no_sep

Cargando…
Cancelar
Guardar