Skip to content

Commit

Permalink
Improve hashmap and hashset
Browse files Browse the repository at this point in the history
  • Loading branch information
Julian LALU committed Jan 17, 2025
1 parent ffbfcb9 commit e86606f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
12 changes: 6 additions & 6 deletions interface/core/containers/hashmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ namespace hud
{
namespace details::hashmap
{
template<typename element_t>
template<typename key_t, typename value_t>
struct hashmap_slot_func
{
using element_type = element_t;
using key_type = typename element_type::first_type;
using value_type = typename element_type::second_type;
using element_type = hud::pair<key_t, value_t>;
using key_type = key_t;
using value_type = value_t;

[[nodiscard]] static constexpr key_type &get_key(element_type &pair) noexcept
{
Expand Down Expand Up @@ -83,11 +83,11 @@ namespace hud
typename key_equal_t = hashmap_default_key_equal<key_t>,
typename allocator_t = hashmap_default_allocator>
class hashmap
: public details::hashset::hashset_impl<details::hashmap::hashmap_slot_func<hud::pair<key_t, value_t>>, hasher_t, key_equal_t, allocator_t>
: public details::hashset::hashset_impl<details::hashmap::hashmap_slot_func<key_t, value_t>, hasher_t, key_equal_t, allocator_t>
{

private:
using super = details::hashset::hashset_impl<details::hashmap::hashmap_slot_func<hud::pair<key_t, value_t>>, hasher_t, key_equal_t, allocator_t>;
using super = details::hashset::hashset_impl<details::hashmap::hashmap_slot_func<key_t, value_t>, hasher_t, key_equal_t, allocator_t>;

public:
/** Type of the hash function. */
Expand Down
1 change: 0 additions & 1 deletion interface/core/containers/hashset.h
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,6 @@ namespace hud
struct tuple_element<index, hud::pair<f, s>>
: hud::tuple_element<index, hud::pair<f, s>>
{
// using type = hud::pair<f, s>;
};

} // namespace details::hashset
Expand Down

0 comments on commit e86606f

Please sign in to comment.