@@ -869,10 +869,10 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
869
869
"""
870
870
cdef:
871
871
ndarray[int64_t] trans
872
- int64_t[:] deltas, idx_shifted
872
+ int64_t[:] deltas, idx_shifted, idx_shifted_left, idx_shifted_right
873
873
ndarray ambiguous_array
874
874
Py_ssize_t i, idx, pos, ntrans, n = len (vals)
875
- Py_ssize_t delta_idx_offset, delta_idx
875
+ Py_ssize_t delta_idx_offset, delta_idx, pos_left, pos_right
876
876
int64_t * tdata
877
877
int64_t v, left, right, val, v_left, v_right, new_local, remaining_mins
878
878
ndarray[int64_t] result, result_a, result_b, dst_hours
@@ -927,8 +927,8 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
927
927
# result_a) or right of the DST transition (store in result_b)
928
928
result_a = np.empty(n, dtype = np.int64)
929
929
result_b = np.empty(n, dtype = np.int64)
930
- result_a.fill( NPY_NAT)
931
- result_b.fill( NPY_NAT)
930
+ result_a[:] = NPY_NAT
931
+ result_b[:] = NPY_NAT
932
932
933
933
idx_shifted_left = (np.maximum(0 , trans.searchsorted(
934
934
vals - DAY_NS, side = ' right' ) - 1 )).astype(np.int64)
@@ -952,7 +952,7 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
952
952
953
953
if infer_dst:
954
954
dst_hours = np.empty(n, dtype = np.int64)
955
- dst_hours.fill( NPY_NAT)
955
+ dst_hours[:] = NPY_NAT
956
956
957
957
# Get the ambiguous hours (given the above, these are the hours
958
958
# where result_a != result_b and neither of them are NAT)
@@ -1045,8 +1045,10 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, object ambiguous=None,
1045
1045
return result
1046
1046
1047
1047
1048
- cdef inline bisect_right_i8(int64_t * data, int64_t val, Py_ssize_t n):
1049
- cdef Py_ssize_t pivot, left = 0 , right = n
1048
+ cdef inline Py_ssize_t bisect_right_i8(int64_t * data,
1049
+ int64_t val, Py_ssize_t n):
1050
+ cdef:
1051
+ Py_ssize_t pivot, left = 0 , right = n
1050
1052
1051
1053
assert n >= 1
1052
1054
0 commit comments