summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolfgang Rohdewald <wolfgang@rohdewald.de>2015-11-24 13:20:46 (GMT)
committerWolfgang Rohdewald <wolfgang@rohdewald.de>2016-08-24 11:47:07 (GMT)
commit2dd577a947b5115bfb05f7ce46ca1496beb6e94e (patch)
tree131a263639118aeabae6bb1824a1d71db903656b
parent127466eb2aa1a56634b990a0fb96ac0825c45bda (diff)
Hand.__init__: small optimization
-rw-r--r--src/hand.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/hand.py b/src/hand.py
index e543f05..31571f4 100644
--- a/src/hand.py
+++ b/src/hand.py
@@ -97,11 +97,8 @@ class Hand(object):
# shortcuts for speed:
self._player = weakref.ref(player)
- self.ruleset = self.player.game.ruleset
- if self.player:
- self.intelligence = self.player.intelligence
- else:
- self.intelligence = AIDefault()
+ self.ruleset = player.game.ruleset
+ self.intelligence = player.intelligence if player else AIDefault()
self.string = string
self.__robbedTile = Tile.unknown
@@ -130,7 +127,7 @@ class Hand(object):
self.__parseString(string)
- self.__won = self.lenOffset == 1 and self.player.mayWin
+ self.__won = self.lenOffset == 1 and player.mayWin
try:
self.__arrange()
self.__calculate()