Commit 76e20b6b authored by Philip Trettner's avatar Philip Trettner
Browse files

improved hash for handles

parent a9f10730
......@@ -22,11 +22,11 @@ struct hash
template <class tag>
size_t operator()(polymesh::primitive_handle<tag> const& i) const noexcept
{
return i.idx.value;
return size_t(i.idx.value) ^ size_t(i.mesh);
}
size_t operator()(polymesh::face_handle const& i) const noexcept { return i.idx.value; }
size_t operator()(polymesh::vertex_handle const& i) const noexcept { return i.idx.value; }
size_t operator()(polymesh::edge_handle const& i) const noexcept { return i.idx.value; }
size_t operator()(polymesh::halfedge_handle const& i) const noexcept { return i.idx.value; }
size_t operator()(polymesh::face_handle const& i) const noexcept { return size_t(i.idx.value) ^ size_t(i.mesh); }
size_t operator()(polymesh::vertex_handle const& i) const noexcept { return size_t(i.idx.value) ^ size_t(i.mesh); }
size_t operator()(polymesh::edge_handle const& i) const noexcept { return size_t(i.idx.value) ^ size_t(i.mesh); }
size_t operator()(polymesh::halfedge_handle const& i) const noexcept { return size_t(i.idx.value) ^ size_t(i.mesh); }
};
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment