Skip to content

Commit

Permalink
Fix minor bug, set self.cache on early exit
Browse files Browse the repository at this point in the history
  • Loading branch information
gaffney2010 committed Nov 11, 2024
1 parent 8c49ea3 commit 9e36c76
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions axelrod/match.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ def play(self):
cache_key = (self.players[0], self.players[1])

if self._cached_enough_turns(cache_key, turns):
return self._cache[cache_key][:turns]
self.result = self._cache[cache_key][:turns]
return self.result

for p in self.players:
if self.reset:
Expand All @@ -202,7 +203,7 @@ def play(self):
self._cache[cache_key] = result

self.result = result
return result
return self.result

def scores(self):
"""Returns the scores of the previous Match plays."""
Expand Down

0 comments on commit 9e36c76

Please sign in to comment.