reuse already split output for filtering (#4310)

there is no need to call out.split('\n') multiple times (line 275 and 277)
This commit is contained in:
Jan Malte Gerth 2016-08-10 11:26:18 +02:00 committed by Matt Clay
parent 81e87cefd7
commit 9549883e78

View file

@ -274,7 +274,7 @@ def main():
lines = out.split('\n') lines = out.split('\n')
filt = globals().get(command + "_filter_output", None) filt = globals().get(command + "_filter_output", None)
if filt: if filt:
filtered_output = filter(filt, out.split('\n')) filtered_output = filter(filt, lines)
if len(filtered_output): if len(filtered_output):
changed = filtered_output changed = filtered_output