Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
andbag committed Apr 21, 2019
1 parent 71176da commit 54706d5
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/Products/PluginIndexes/TopicIndex/TopicIndex.py
Expand Up @@ -147,7 +147,7 @@ def uniqueValues(self, name=None, withLength=0):
for key, value in self.filteredSets.items():
yield (key, len(value.getIds()))

def getEntryForObject(self, docid, default=_marker):
def getEntryForObject(self, docid, default=None):
""" Takes a document ID and returns all the information we have
on that specific object.
"""
Expand All @@ -157,12 +157,7 @@ def getEntryForObject(self, docid, default=_marker):
if docid in ids:
res.append(fs.getId())

if res:
return res
elif default is not _marker:
return default

return None
return res or default

def addFilteredSet(self, filter_id, typeFilteredSet, expr):
# Add a FilteredSet object.
Expand Down

0 comments on commit 54706d5

Please sign in to comment.