diff --git a/include/openmc/cell.h b/include/openmc/cell.h index d3b411dda..3df2f40d5 100644 --- a/include/openmc/cell.h +++ b/include/openmc/cell.h @@ -300,28 +300,18 @@ struct CellInstance { gsl::index index_cell; gsl::index instance; }; -} // namespace openmc -namespace std { -template<> -struct hash { - // Taken from https://stackoverflow.com/a/17017281 - std::size_t operator()(const openmc::CellInstance& k) const +struct CellInstanceHash { + std::size_t operator()(const CellInstance& k) const { - std::size_t res = 17; - res = 31 * res + std::hash()(k.index_cell); - res = 31 * res + std::hash()(k.instance); - return res; + return 4096*k.index_cell + k.instance; } }; -} // namespace std //============================================================================== // Non-member functions //============================================================================== -namespace openmc { - void read_cells(pugi::xml_node node); #ifdef DAGMC diff --git a/include/openmc/tallies/filter_cell_instance.h b/include/openmc/tallies/filter_cell_instance.h index 33874b85d..1b2cdd425 100644 --- a/include/openmc/tallies/filter_cell_instance.h +++ b/include/openmc/tallies/filter_cell_instance.h @@ -55,7 +55,7 @@ private: std::vector cell_instances_; //! A map from cell/instance indices to filter bin indices. - std::unordered_map map_; + std::unordered_map map_; }; } // namespace openmc