From 4433fe90ccfe96cb961f443bbf72ba543feec511 Mon Sep 17 00:00:00 2001 From: Kevin Pedro Date: Fri, 10 Apr 2020 10:19:52 -0500 Subject: [PATCH] speed up filesFromList --- Configuration/Applications/python/ConfigBuilder.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Configuration/Applications/python/ConfigBuilder.py b/Configuration/Applications/python/ConfigBuilder.py index f84ba00b46290..2dfa0cb1430b1 100644 --- a/Configuration/Applications/python/ConfigBuilder.py +++ b/Configuration/Applications/python/ConfigBuilder.py @@ -102,14 +102,14 @@ def filesFromList(fileName,s=None): if line.count(".root")>=2: #two files solution... entries=line.replace("\n","").split() - if not entries[0] in prim: - prim.append(entries[0]) - if not entries[1] in sec: - sec.append(entries[1]) + prim.append(entries[0]) + sec.append(entries[1]) elif (line.find(".root")!=-1): entry=line.replace("\n","") - if not entry in prim: - prim.append(entry) + prim.append(entry) + # remove any duplicates + prim = sorted(list(set(prim))) + sec = sorted(list(set(sec))) if s: if not hasattr(s,"fileNames"): s.fileNames=cms.untracked.vstring(prim)