diff --git a/AK/Time.cpp b/AK/Time.cpp index 61bc20e2b0..170446b0a3 100644 --- a/AK/Time.cpp +++ b/AK/Time.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include @@ -21,7 +22,7 @@ int day_of_year(int year, unsigned month, int day) { VERIFY(month >= 1 && month <= 12); - static const int seek_table[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; + constexpr Array seek_table = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; int day_of_year = seek_table[month - 1] + day - 1; if (is_leap_year(year) && month >= 3) @@ -43,7 +44,7 @@ int days_in_month(int year, unsigned month) unsigned day_of_week(int year, unsigned month, int day) { VERIFY(month >= 1 && month <= 12); - static const int seek_table[] = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }; + constexpr Array seek_table = { 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 }; if (month < 3) --year;