Skip to content

Commit

Permalink
Fix base key and mask to use key_array when provided
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Sep 22, 2017
1 parent 0c9ed82 commit 3b8a731
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pacman/model/routing_info/base_key_and_mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,9 @@ def get_keys(self, key_array=None, offset=0, n_keys=None):
# If there are no zeros, there is only one key in the range, so
# return that
if len(zeros) == 0:
key_array = numpy.zeros(1, dtype=">u4")
key_array[0] = self._base_key
if key_array is None:
key_array = numpy.zeros(1, dtype=">u4")
key_array[offset] = self._base_key
return key_array, 1

# We now know how many values there are - 2^len(zeros)
Expand Down

0 comments on commit 3b8a731

Please sign in to comment.