Codechange: Simplify ConvertDateToYMD by returning YearMonthDay instead of outputting to a pointer. (#11637)

This commit is contained in:
Peter Nelson
2023-12-28 21:34:08 +00:00
committed by GitHub
parent bd3b28551e
commit 33ff64ef74
16 changed files with 31 additions and 51 deletions

View File

@@ -29,8 +29,7 @@
{
if (date < 0) return DATE_INVALID;
::TimerGameCalendar::YearMonthDay ymd;
::TimerGameCalendar::ConvertDateToYMD(date, &ymd);
::TimerGameCalendar::YearMonthDay ymd = ::TimerGameCalendar::ConvertDateToYMD(date);
return ymd.year.base();
}
@@ -38,8 +37,7 @@
{
if (date < 0) return DATE_INVALID;
::TimerGameCalendar::YearMonthDay ymd;
::TimerGameCalendar::ConvertDateToYMD(date, &ymd);
::TimerGameCalendar::YearMonthDay ymd = ::TimerGameCalendar::ConvertDateToYMD(date);
return ymd.month + 1;
}
@@ -47,8 +45,7 @@
{
if (date < 0) return DATE_INVALID;
::TimerGameCalendar::YearMonthDay ymd;
::TimerGameCalendar::ConvertDateToYMD(date, &ymd);
::TimerGameCalendar::YearMonthDay ymd = ::TimerGameCalendar::ConvertDateToYMD(date);
return ymd.day;
}