Skip to content

Commit

Permalink
Merge pull request #29454 from kpedro88/filesFromList
Browse files Browse the repository at this point in the history
Speed up filesFromList and filesFromDASQuery in ConfigBuilder.py
  • Loading branch information
cmsbuild authored Apr 16, 2020
2 parents 1056806 + 2985833 commit bb37344
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions Configuration/Applications/python/ConfigBuilder.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,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)
Expand Down Expand Up @@ -156,14 +156,14 @@ def filesFromDASQuery(query,option="",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)
Expand Down

0 comments on commit bb37344

Please sign in to comment.