Micro-optimization of inventory.expand_hosts.detect_range

pull/5737/merge
Cristian Ciupitu 11 years ago committed by Michael DeHaan
parent 7b2fb7e2d1
commit a7da5d8702

@ -41,10 +41,7 @@ def detect_range(line = None):
Returnes True if the given line contains a pattern, else False.
'''
if (line.find("[") != -1 and
line.find(":") != -1 and
line.find("]") != -1 and
line.index("[") < line.index(":") < line.index("]")):
if 0 <= line.find("[") < line.find(":") < line.find("]"):
return True
else:
return False

Loading…
Cancel
Save