From e63aa18c5804a65be5c6684d7213b85cd65b149d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Sat, 27 Jan 2018 16:39:08 +0100 Subject: [PATCH] Remove useless hashtable over doubles (wtf was I thinking?) --- Mesh.cpp | 5 ----- Mesh.hpp | 1 - common_structures.hpp | 9 --------- 3 files changed, 15 deletions(-) diff --git a/Mesh.cpp b/Mesh.cpp index 125ab80..815aad2 100644 --- a/Mesh.cpp +++ b/Mesh.cpp @@ -5,12 +5,7 @@ Mesh::Mesh() } size_t Mesh::add_vertice(const Point& pt) { - // Does the vertice already exists? - if (rev_vertices.find(pt) != rev_vertices.end()) - return rev_vertices.find(pt)->second; - vertices.push_back(pt); - rev_vertices.insert(std::make_pair(pt, vertices.size() - 1)); return vertices.size() - 1; } diff --git a/Mesh.hpp b/Mesh.hpp index f66c9d9..63ea5f8 100644 --- a/Mesh.hpp +++ b/Mesh.hpp @@ -26,6 +26,5 @@ class Mesh { private: std::vector vertices; - std::unordered_map rev_vertices; std::vector faces; }; diff --git a/common_structures.hpp b/common_structures.hpp index 173679f..3993966 100644 --- a/common_structures.hpp +++ b/common_structures.hpp @@ -22,15 +22,6 @@ struct Face { }; namespace std { - template<> struct hash { typedef Point argument_type; - typedef std::size_t result_type; - result_type operator()(const argument_type& pt) const noexcept { - return (hash()(pt.x) << 2) - ^ (hash()(pt.y) << 1) - ^ hash()(pt.z); - } - }; - template<> struct hash { typedef Face argument_type;