From e03b89806aff70611b7be310c51a84d87fc8bb42 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 4 Feb 2017 11:47:32 -0500 Subject: [PATCH] Shorten two methods by directly returning the condition. --- xonstat/views/submission.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/xonstat/views/submission.py b/xonstat/views/submission.py index 40f735d..322fd5f 100644 --- a/xonstat/views/submission.py +++ b/xonstat/views/submission.py @@ -20,10 +20,7 @@ def is_real_player(events): """ Determines if a given set of events correspond with a non-bot """ - if not events['P'].startswith('bot'): - return True - else: - return False + return not events['P'].startswith('bot') def played_in_game(events): @@ -31,10 +28,7 @@ def played_in_game(events): Determines if a given set of player events correspond with a player who played in the game (matches 1 and scoreboardvalid 1) """ - if 'matches' in events and 'scoreboardvalid' in events: - return True - else: - return False + return 'matches' in events and 'scoreboardvalid' in events class Submission(object): -- 2.39.2