From 395ee53424a2ccb612a80ffca4a8fc9ed54465e2 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 19 Nov 2020 14:32:17 +0000 Subject: [PATCH] Simplify --- webapp_hashtagswarm.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/webapp_hashtagswarm.py b/webapp_hashtagswarm.py index ae63481b..3b858278 100644 --- a/webapp_hashtagswarm.py +++ b/webapp_hashtagswarm.py @@ -39,25 +39,15 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str: continue with open(tagsFilename, 'r') as tagsFile: line = tagsFile.readline() - lineCtr = 1 tagCtr = 0 - maxLineCtr = 1 while line: if ' ' not in line: line = tagsFile.readline() - lineCtr += 1 - # don't read too many lines - if lineCtr >= maxLineCtr: - break - continue + break postDaysSinceEpochStr = line.split(' ')[0] if not postDaysSinceEpochStr.isdigit(): line = tagsFile.readline() - lineCtr += 1 - # don't read too many lines - if lineCtr >= maxLineCtr: - break - continue + break postDaysSinceEpoch = int(postDaysSinceEpochStr) if postDaysSinceEpoch < daysSinceEpoch: break @@ -67,10 +57,7 @@ def htmlHashTagSwarm(baseDir: str, actor: str) -> str: tagCtr += 1 line = tagsFile.readline() - lineCtr += 1 - # don't read too many lines - if lineCtr >= maxLineCtr: - break + break if not tagSwarm: return ''