Skip to content

Commit cf7d794

Browse files
committed
fix
1 parent e4ee5b5 commit cf7d794

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pandas/_libs/new_vector.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ template <typename T> class PandasVector {
112112

113113
template <typename T, bool IsMasked> class PandasHashTable {
114114
public:
115+
using pd_khint_t = size_t;
115116
explicit PandasHashTable<T, IsMasked>() = default;
116117
explicit PandasHashTable<T, IsMasked>(size_t new_size) {
117118
// historically pandas would take a size_hint constructor and pass
@@ -136,7 +137,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
136137
auto SizeOf() const noexcept -> size_t {
137138
constexpr size_t overhead = 4 * sizeof(uint32_t) + 3 * sizeof(uint32_t *);
138139
const auto for_flags =
139-
std::max(1U, hash_map_.n_buckets() >> 5) * sizeof(uint32_t);
140+
std::max(static_cast<pd_khint_t>(1), hash_map_.n_buckets() >> 5) * sizeof(uint32_t);
140141
const auto for_pairs =
141142
hash_map_.n_buckets() * (sizeof(T) + sizeof(Py_ssize_t));
142143

@@ -662,7 +663,7 @@ template <typename T, bool IsMasked> class PandasHashTable {
662663
return;
663664
}
664665

665-
klib::KHashMap<T, size_t, PandasHashFunction<T>, PandasHashEquality<T>, size_t>
666+
klib::KHashMap<T, size_t, PandasHashFunction<T>, PandasHashEquality<T>, pd_khint_t>
666667
hash_map_;
667668
Py_ssize_t na_position_ = -1;
668669
};

0 commit comments

Comments
 (0)