]> git.rm.cloudns.org Git - xonotic/xonstat.git/commitdiff
Shorten two methods by directly returning the condition.
authorAnt Zucaro <azucaro@gmail.com>
Sat, 4 Feb 2017 16:47:32 +0000 (11:47 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Sat, 4 Feb 2017 16:47:32 +0000 (11:47 -0500)
xonstat/views/submission.py

index 40f735d01e99395548ce9834f53d45a0782699b9..322fd5f81afd2814ceec89c353f7ebaa5bdd06bb 100644 (file)
@@ -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):