@@ -33,8 +33,7 @@ def inner_join(const intp_t[:] left, const intp_t[:] right,
33
33
Py_ssize_t max_groups ):
34
34
cdef:
35
35
Py_ssize_t i, j, k, count = 0
36
- ndarray[intp_t] left_sorter, right_sorter
37
- ndarray[int64_t] left_count, right_count
36
+ ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
38
37
ndarray[int64_t] left_indexer, right_indexer
39
38
int64_t lc, rc
40
39
Py_ssize_t loc, left_pos = 0 , right_pos = 0 , position = 0
@@ -85,8 +84,8 @@ def left_outer_join(const intp_t[:] left, const intp_t[:] right,
85
84
Py_ssize_t max_groups , bint sort = True ):
86
85
cdef:
87
86
Py_ssize_t i, j, k, count = 0
88
- ndarray[int64_t] left_count, right_count
89
- ndarray[intp_t] rev, left_sorter, right_sorter
87
+ ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
88
+ ndarray rev
90
89
ndarray[int64_t] left_indexer, right_indexer
91
90
int64_t lc, rc
92
91
Py_ssize_t loc, left_pos = 0 , right_pos = 0 , position = 0
@@ -158,8 +157,7 @@ def full_outer_join(const intp_t[:] left, const intp_t[:] right,
158
157
Py_ssize_t max_groups ):
159
158
cdef:
160
159
Py_ssize_t i, j, k, count = 0
161
- ndarray[intp_t] left_sorter, right_sorter
162
- ndarray[int64_t] left_count, right_count
160
+ ndarray[int64_t] left_count, right_count, left_sorter, right_sorter
163
161
ndarray[int64_t] left_indexer, right_indexer
164
162
int64_t lc, rc
165
163
int64_t left_pos = 0 , right_pos = 0
@@ -217,16 +215,12 @@ def full_outer_join(const intp_t[:] left, const intp_t[:] right,
217
215
_get_result_indexer(right_sorter, right_indexer))
218
216
219
217
220
- cdef ndarray[int64_t] _get_result_indexer(
221
- ndarray[intp_t] sorter, ndarray[int64_t] indexer
222
- ):
218
+ cdef _get_result_indexer(ndarray[int64_t] sorter, ndarray[int64_t] indexer):
223
219
if len (sorter) > 0 :
224
220
# cython-only equivalent to
225
221
# `res = algos.take_nd(sorter, indexer, fill_value=-1)`
226
222
res = np.empty(len (indexer), dtype = np.int64)
227
- take_1d_int64_int64(ensure_int64(sorter), ensure_platform_int(indexer), res, - 1 )
228
- # FIXME: sorter is intp_t, not int64_t, opposite for indexer;
229
- # will this break on 32bit builds?
223
+ take_1d_int64_int64(sorter, indexer, res, - 1 )
230
224
else :
231
225
# length-0 case
232
226
res = np.empty(len (indexer), dtype = np.int64)
0 commit comments