@@ -557,30 +557,25 @@ cdef int64_t[:] _tz_convert_dst(
557
557
ndarray[int64_t] trans
558
558
int64_t[:] deltas
559
559
int64_t v
560
- bint tz_is_local
561
560
562
- tz_is_local = is_tzlocal(tz)
561
+ # tz is assumed _not_ to be tzlocal; that should go
562
+ # through _tz_convert_tzlocal_utc
563
563
564
- if not tz_is_local:
565
- # get_dst_info cannot extract offsets from tzlocal because its
566
- # dependent on a datetime
567
- trans, deltas, _ = get_dst_info(tz)
568
- if not to_utc:
569
- # We add `offset` below instead of subtracting it
570
- deltas = - 1 * np.array(deltas, dtype = ' i8' )
564
+ trans, deltas, _ = get_dst_info(tz)
565
+ if not to_utc:
566
+ # We add `offset` below instead of subtracting it
567
+ deltas = - 1 * np.array(deltas, dtype = ' i8' )
571
568
572
- # Previously, this search was done pointwise to try and benefit
573
- # from getting to skip searches for iNaTs. However, it seems call
574
- # overhead dominates the search time so doing it once in bulk
575
- # is substantially faster (GH#24603)
576
- pos = trans.searchsorted(values, side = ' right' ) - 1
569
+ # Previously, this search was done pointwise to try and benefit
570
+ # from getting to skip searches for iNaTs. However, it seems call
571
+ # overhead dominates the search time so doing it once in bulk
572
+ # is substantially faster (GH#24603)
573
+ pos = trans.searchsorted(values, side = ' right' ) - 1
577
574
578
575
for i in range (n):
579
576
v = values[i]
580
577
if v == NPY_NAT:
581
578
result[i] = v
582
- elif tz_is_local:
583
- result[i] = _tz_convert_tzlocal_utc(v, tz, to_utc = to_utc)
584
579
else :
585
580
if pos[i] < 0 :
586
581
raise ValueError (' First time before start of DST info' )
0 commit comments