Add fast path for NavPoint equality.

Hot method and the FFI costs for comparing the points are not cheap.
This commit is contained in:
Dan Albert 2020-12-24 02:06:08 -08:00
parent 9a374711fd
commit 67a9df686e

View File

@ -50,6 +50,9 @@ class NavPoint:
return hash(self.poly.ident)
def __eq__(self, other: object) -> bool:
if id(self) == id(other):
return True
if not isinstance(other, NavPoint):
return False