mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Convert if to switch statement.
This commit is contained in:
@@ -299,11 +299,15 @@ public static class DateHandlers
|
|||||||
else
|
else
|
||||||
offset = (short)(preOffset & 0x7FF);
|
offset = (short)(preOffset & 0x7FF);
|
||||||
|
|
||||||
if(offset == -2047)
|
switch(offset)
|
||||||
return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Unspecified).AddTicks(ticks);
|
{
|
||||||
|
case -2047:
|
||||||
|
return new DateTime(year, month, day, hour, minute, second, DateTimeKind.Unspecified).AddTicks(ticks);
|
||||||
|
case < -1440 or > 1440:
|
||||||
|
offset = 0;
|
||||||
|
|
||||||
if(offset is < -1440 or > 1440)
|
break;
|
||||||
offset = 0;
|
}
|
||||||
|
|
||||||
return new DateTimeOffset(year, month, day, hour, minute, second, new TimeSpan(0, offset, 0)).AddTicks(ticks).
|
return new DateTimeOffset(year, month, day, hour, minute, second, new TimeSpan(0, offset, 0)).AddTicks(ticks).
|
||||||
DateTime;
|
DateTime;
|
||||||
|
|||||||
14
PrintHex.cs
14
PrintHex.cs
@@ -62,11 +62,17 @@ public static class PrintHex
|
|||||||
int offsetLength = $"{array.Length:X}".Length;
|
int offsetLength = $"{array.Length:X}".Length;
|
||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
|
|
||||||
if(last > 0)
|
switch(last)
|
||||||
rows++;
|
{
|
||||||
|
case > 0:
|
||||||
|
rows++;
|
||||||
|
|
||||||
if(last == 0)
|
break;
|
||||||
last = width;
|
case 0:
|
||||||
|
last = width;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if(offsetLength < str.Length)
|
if(offsetLength < str.Length)
|
||||||
offsetLength = str.Length;
|
offsetLength = str.Length;
|
||||||
|
|||||||
Reference in New Issue
Block a user