Skip to content

Commit 2ecc4e9

Browse files
committed
Use CreateTemporalZonedDateTime when internally creating instances of ZDT
This is what we do at most other call sites, there was just one where we called the constructor directly. It is marginally better performance-wise, as it skips the checks for converting external bigint values to JSBI.
1 parent f6bb8bc commit 2ecc4e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/zoneddatetime.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,9 @@ export class ZonedDateTime implements Temporal.ZonedDateTime {
435435
direction === 'next'
436436
? ES.GetNamedTimeZoneNextTransition(timeZone, thisEpochNanoseconds)
437437
: ES.GetNamedTimeZonePreviousTransition(timeZone, thisEpochNanoseconds);
438-
return epochNanoseconds === null ? null : new ZonedDateTime(epochNanoseconds, timeZone, GetSlot(this, CALENDAR));
438+
return epochNanoseconds === null
439+
? null
440+
: ES.CreateTemporalZonedDateTime(epochNanoseconds, timeZone, GetSlot(this, CALENDAR));
439441
}
440442
toInstant(): Return['toInstant'] {
441443
ES.CheckReceiver(this, ES.IsTemporalZonedDateTime);

0 commit comments

Comments
 (0)