Skip to content

Commit

Permalink
Remove unnecessary truncation from Vector3::hash() #16
Browse files Browse the repository at this point in the history
  • Loading branch information
RexBerry committed Mar 10, 2023
1 parent d041e77 commit d1372c6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions flight/avoidance/vector/vector3.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ def to_mavsdk_velocitynedyaw(
return mavsdk.offboard.VelocityNedYaw(self.north, self.east, self.down, yaw_deg)

def __hash__(self) -> int:
big_hash: int = ((hash(self.north) * 3) + hash(self.east)) * 3 + hash(self.down)
return big_hash & 0xFFFF_FFFF_FFFF_FFFF
return ((hash(self.north) * 3) + hash(self.east)) * 3 + hash(self.down)

# Implement unpacking
def __iter__(self) -> Iterator[float]:
Expand Down

0 comments on commit d1372c6

Please sign in to comment.