From 171c59a01b07b7513cf7a281bbcb141e8182d274 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Tue, 2 Jun 2015 13:29:52 +0100 Subject: Changed appropriate containers to unordered_map Thanks to @worktycho for guidance! * Potential speed improvements --- src/Vector3.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Vector3.h') diff --git a/src/Vector3.h b/src/Vector3.h index 346bc1bbb..279fe5cd7 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -235,6 +235,12 @@ public: return *this; } + /** Provides a hash of a vector's contents */ + size_t operator()(const Vector3 & a_Vector) const + { + return ((std::hash()(a_Vector.x) ^ (std::hash()(a_Vector.y) << 1)) ^ std::hash()(a_Vector.z)); + } + // tolua_begin inline Vector3 operator + (const Vector3& a_Rhs) const -- cgit v1.2.3