Skip to content

Commit a390096

Browse files
razfrimanjkotas
authored andcommitted
Remove unused offset calculation (dotnet/coreclr#23793)
Utf8Parser has a redundant calculation of date time offset. Fix #21834 Signed-off-by: dotnet-bot <dotnet-bot@microsoft.com>
1 parent cafde38 commit a390096

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/System.Private.CoreLib/shared/System/Buffers/Text/Utf8Parser/Utf8Parser.Date.Default.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ private static bool TryParseDateTimeOffsetDefault(ReadOnlySpan<byte> source, out
8383
offsetMinutes = (int)(digit1 * 10 + digit2);
8484
}
8585

86-
TimeSpan offset = new TimeSpan(hours: offsetHours, minutes: offsetMinutes, seconds: 0);
87-
if (sign == Utf8Constants.Minus)
88-
{
89-
offset = -offset;
90-
}
91-
9286
if (!TryCreateDateTimeOffset(dateTime: dateTime, offsetNegative: sign == Utf8Constants.Minus, offsetHours: offsetHours, offsetMinutes: offsetMinutes, out value))
9387
{
9488
bytesConsumed = 0;

0 commit comments

Comments
 (0)