1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-21 19:52:55 +08:00

Fix code quality and formatting issues

This commit is contained in:
WitherFlower 2024-10-09 13:29:03 +02:00
parent b58576f31b
commit 6b532824b1
2 changed files with 38 additions and 58 deletions

View File

@ -642,7 +642,6 @@ namespace osu.Game.Screens.Select
switch (key) switch (key)
{ {
case @"year": case @"year":
year = (int)value; year = (int)value;
break; break;
@ -670,14 +669,8 @@ namespace osu.Game.Screens.Select
switch (op) switch (op)
{ {
case Operator.Less: case Operator.Less:
if (month == null) month ??= 1;
{ day ??= 1;
month = 1;
day = 1;
}
if (day == null)
day = 1;
dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value); dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value);
return tryUpdateCriteriaRange(ref dateRange, op, dateTimeOffset); return tryUpdateCriteriaRange(ref dateRange, op, dateTimeOffset);
@ -690,6 +683,7 @@ namespace osu.Game.Screens.Select
dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddYears(1); dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddYears(1);
return tryUpdateCriteriaRange(ref dateRange, Operator.Less, dateTimeOffset); return tryUpdateCriteriaRange(ref dateRange, Operator.Less, dateTimeOffset);
} }
if (day == null) if (day == null)
{ {
day = 1; day = 1;
@ -701,14 +695,8 @@ namespace osu.Game.Screens.Select
return tryUpdateCriteriaRange(ref dateRange, Operator.Less, dateTimeOffset); return tryUpdateCriteriaRange(ref dateRange, Operator.Less, dateTimeOffset);
case Operator.GreaterOrEqual: case Operator.GreaterOrEqual:
if (month == null) month ??= 1;
{ day ??= 1;
month = 1;
day = 1;
}
if (day == null)
day = 1;
dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value); dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value);
return tryUpdateCriteriaRange(ref dateRange, op, dateTimeOffset); return tryUpdateCriteriaRange(ref dateRange, op, dateTimeOffset);
@ -721,6 +709,7 @@ namespace osu.Game.Screens.Select
dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddYears(1); dateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddYears(1);
return tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, dateTimeOffset); return tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, dateTimeOffset);
} }
if (day == null) if (day == null)
{ {
day = 1; day = 1;
@ -742,11 +731,8 @@ namespace osu.Game.Screens.Select
day = 1; day = 1;
minDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value); minDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value);
maxDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddYears(1); maxDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddYears(1);
return ( return tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, minDateTimeOffset)
tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, minDateTimeOffset) && tryUpdateCriteriaRange(ref dateRange, Operator.Less, maxDateTimeOffset);
&&
tryUpdateCriteriaRange(ref dateRange, Operator.Less, maxDateTimeOffset)
);
} }
if (day == null) if (day == null)
@ -754,21 +740,15 @@ namespace osu.Game.Screens.Select
day = 1; day = 1;
minDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value); minDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value);
maxDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddMonths(1); maxDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddMonths(1);
return ( return tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, minDateTimeOffset)
tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, minDateTimeOffset) && tryUpdateCriteriaRange(ref dateRange, Operator.Less, maxDateTimeOffset);
&&
tryUpdateCriteriaRange(ref dateRange, Operator.Less, maxDateTimeOffset)
);
} }
minDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value); minDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value);
maxDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddDays(1); maxDateTimeOffset = dateTimeOffsetFromDateOnly(year.Value, month.Value, day.Value).AddDays(1);
return tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, minDateTimeOffset)
&& tryUpdateCriteriaRange(ref dateRange, Operator.Less, maxDateTimeOffset);
return (
tryUpdateCriteriaRange(ref dateRange, Operator.GreaterOrEqual, minDateTimeOffset)
&&
tryUpdateCriteriaRange(ref dateRange, Operator.Less, maxDateTimeOffset)
);
default: default:
return false; return false;
} }