Remove unused offset calculation (#23793)
authorRaz Friman <raz.friman@razfriman.com>
Mon, 15 Apr 2019 01:29:10 +0000 (11:29 +1000)
committerStephen Toub <stoub@microsoft.com>
Mon, 15 Apr 2019 01:29:10 +0000 (21:29 -0400)
Utf8Parser has a redundant calculation of date time offset.

Fix #21834

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

index fdf7998..4df3703 100644 (file)
@@ -83,12 +83,6 @@ namespace System.Buffers.Text
                 offsetMinutes = (int)(digit1 * 10 + digit2);
             }
 
-            TimeSpan offset = new TimeSpan(hours: offsetHours, minutes: offsetMinutes, seconds: 0);
-            if (sign == Utf8Constants.Minus)
-            {
-                offset = -offset;
-            }
-
             if (!TryCreateDateTimeOffset(dateTime: dateTime, offsetNegative: sign == Utf8Constants.Minus, offsetHours: offsetHours, offsetMinutes: offsetMinutes, out value))
             {
                 bytesConsumed = 0;