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. Returnes True if the given line contains a pattern, else False.
''' '''
if (line.find("[") != -1 and if 0 <= line.find("[") < line.find(":") < line.find("]"):
line.find(":") != -1 and
line.find("]") != -1 and
line.index("[") < line.index(":") < line.index("]")):
return True return True
else: else:
return False return False

Loading…
Cancel
Save