From 5cc8b5a68c4984f3028e1a145dfd5a0e524c5ef5 Mon Sep 17 00:00:00 2001 From: Andrew Dickinson Date: Mon, 13 Apr 2020 19:35:52 -0400 Subject: [PATCH] Replace loop in web.py with generator expression Co-Authored-By: Glandos --- ihatemoney/web.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ihatemoney/web.py b/ihatemoney/web.py index 5bb6c54a..e1e0eb8b 100644 --- a/ihatemoney/web.py +++ b/ihatemoney/web.py @@ -750,11 +750,7 @@ def history(): """Query for the version entries associated with this project.""" history = get_history(g.project, human_readable_names=True) - any_ip_addresses = False - for event in history: - if event["ip"]: - any_ip_addresses = True - break + any_ip_addresses = any(event["ip"] for event in history) return render_template( "history.html",