##// END OF EJS Templates
match: optimize _patsplit
Matt Mackall -
r8579:aff7f83c default
parent child Browse files
Show More
@@ -59,8 +59,10 b' def patkind(pat):'
59 def _patsplit(pat, default):
59 def _patsplit(pat, default):
60 """Split a string into an optional pattern kind prefix and the
60 """Split a string into an optional pattern kind prefix and the
61 actual pattern."""
61 actual pattern."""
62 for prefix in 're', 'glob', 'path', 'relglob', 'relpath', 'relre':
62 if ':' in pat:
63 if pat.startswith(prefix + ':'): return pat.split(':', 1)
63 pat, val = pat.split(':', 1)
64 if pat in ('re', 'glob', 'path', 'relglob', 'relpath', 'relre'):
65 return pat, val
64 return default, pat
66 return default, pat
65
67
66 def _globre(pat, head, tail):
68 def _globre(pat, head, tail):
General Comments 0
You need to be logged in to leave comments. Login now