From 38de54151355321223f956be5cd90cfdeb40b749 Mon Sep 17 00:00:00 2001 From: David Trail Date: Sun, 18 Oct 2015 16:58:49 +0100 Subject: [PATCH] I don't think we actually can iterate over > 1000 --- shreddit.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/shreddit.py b/shreddit.py index 9539345..e33d275 100755 --- a/shreddit.py +++ b/shreddit.py @@ -127,7 +127,6 @@ def get_things(after=None): def remove_things(things): - removal_count = 0 for thing in things: # Seems to be in users's timezone. Unclear. thing_time = datetime.fromtimestamp(thing.created_utc) @@ -192,11 +191,5 @@ def remove_things(things): thing.edit(replacement_text) if not edit_only: thing.delete() - removal_count += 1 - return removal_count - -things = get_things() -count = remove_things(things) -while count != 0: - things = get_things() - count = remove_things(things) + +remove_things(get_things())