Skip to content

Commit 92586ba

Browse files
authored
PERF: fix regression in tz_convert_from_utc (#38074)
1 parent 51750be commit 92586ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/_libs/tslibs/tzconversion.pyx

+3-3
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ def tz_convert_from_utc(const int64_t[:] vals, tzinfo tz):
426426
int64 ndarray of converted
427427
"""
428428
cdef:
429-
int64_t[:] converted
429+
const int64_t[:] converted
430430

431431
if len(vals) == 0:
432432
return np.array([], dtype=np.int64)
@@ -437,7 +437,7 @@ def tz_convert_from_utc(const int64_t[:] vals, tzinfo tz):
437437

438438
@cython.boundscheck(False)
439439
@cython.wraparound(False)
440-
cdef int64_t[:] _tz_convert_from_utc(const int64_t[:] vals, tzinfo tz):
440+
cdef const int64_t[:] _tz_convert_from_utc(const int64_t[:] vals, tzinfo tz):
441441
"""
442442
Convert the given values (in i8) either to UTC or from UTC.
443443
@@ -459,7 +459,7 @@ cdef int64_t[:] _tz_convert_from_utc(const int64_t[:] vals, tzinfo tz):
459459
str typ
460460

461461
if is_utc(tz):
462-
converted = vals.copy()
462+
return vals
463463
elif is_tzlocal(tz):
464464
converted = np.empty(n, dtype=np.int64)
465465
for i in range(n):

0 commit comments

Comments
 (0)