From 4d2d863fb732f4b1080e8b96a9d83cae841eec0b Mon Sep 17 00:00:00 2001 From: eeemsi Date: Sun, 5 Feb 2023 10:11:54 +0100 Subject: [PATCH] chore (mark_as_read.py): reduce a nested for loop to enhance readability --- mark_as_read.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/mark_as_read.py b/mark_as_read.py index f4ca016..bf6d597 100644 --- a/mark_as_read.py +++ b/mark_as_read.py @@ -47,12 +47,14 @@ def get_ids_older_ndays(): entries = request_unread.json() - if entries["entries"]: - for item in entries["entries"]: - if item['feed']['category']['title'] in config['options']['ignore']: - continue + if not entries["entries"]: + return - id_array.append(item["id"]) + for item in entries["entries"]: + if item['feed']['category']['title'] in config['options']['ignore']: + continue + + id_array.append(item["id"]) def mark_as_read(): """ mark ids from id_array as read