diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-05-21 01:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-21 01:06:21 +0200 |
commit | 8adf04804550957f43c810b13fcce66dd76e5fd8 (patch) | |
tree | 2ee58365f1092587277770ceaedfc1e35454acfd /core/math/a_star.h | |
parent | f4126cc902b0cbb100bcf1b37ee15df5a8430d21 (diff) | |
parent | 45af29da8095af16729955117a165d23e77cd740 (diff) |
Merge pull request #61194 from reduz/new-hash-set
Add a new HashSet template
Diffstat (limited to 'core/math/a_star.h')
-rw-r--r-- | core/math/a_star.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/math/a_star.h b/core/math/a_star.h index 086be839b5..e2f75ad18c 100644 --- a/core/math/a_star.h +++ b/core/math/a_star.h @@ -92,7 +92,10 @@ class AStar3D : public RefCounted { }; unsigned char direction = NONE; - bool operator<(const Segment &p_s) const { return key < p_s.key; } + static uint32_t hash(const Segment &p_seg) { + return hash_one_uint64(p_seg.key); + } + bool operator==(const Segment &p_s) const { return key == p_s.key; } Segment() {} Segment(int p_from, int p_to) { @@ -112,7 +115,7 @@ class AStar3D : public RefCounted { uint64_t pass = 1; OAHashMap<int, Point *> points; - RBSet<Segment> segments; + HashSet<Segment, Segment> segments; bool _solve(Point *begin_point, Point *end_point); |