Avoid lookups if not needed

merge-requests/8/head
Bob Mottram 2020-10-09 14:20:45 +01:00
parent d60aad0659
commit 19a420f758
1 changed files with 6 additions and 5 deletions

View File

@ -5419,11 +5419,12 @@ def htmlNewswire(newswire: str, nickname: str, moderator: bool,
moderatedItem = False
if moderator:
moderatedItem = item[5]
totalVotes = votesOnNewswireItem(item[2])
# show a number of ticks or crosses for how many
# votes for or against
totalVotesStr = \
votesIndicator(totalVotes, positiveVoting)
if moderatedItem:
totalVotes = votesOnNewswireItem(item[2])
# show a number of ticks or crosses for how many
# votes for or against
totalVotesStr = \
votesIndicator(totalVotes, positiveVoting)
if moderator and moderatedItem:
htmlStr += '<p class="newswireItemModerated">' + \