From: Ant Zucaro Date: Sat, 4 Feb 2017 16:47:32 +0000 (-0500) Subject: Shorten two methods by directly returning the condition. X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fxonstat.git;a=commitdiff_plain;h=e03b89806aff70611b7be310c51a84d87fc8bb42 Shorten two methods by directly returning the condition. --- 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):