From 41ece0e405278f7e484667cd1d1d99242aa321d4 Mon Sep 17 00:00:00 2001 From: pupbrained Date: Mon, 12 May 2025 02:21:52 -0400 Subject: [PATCH] thats better --- src/Core/SystemData.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Core/SystemData.cpp b/src/Core/SystemData.cpp index 0f868f3..aabb22e 100644 --- a/src/Core/SystemData.cpp +++ b/src/Core/SystemData.cpp @@ -20,16 +20,14 @@ namespace { using util::types::i32, util::types::CStr; fn getOrdinalSuffix(const i32 day) -> CStr { - using matchit::match, matchit::is, matchit::_, matchit::or_; + using matchit::match, matchit::is, matchit::_, matchit::in; - if (day == 11 || day == 12 || day == 13) - return "th"; - - return match(day % 10)( - is | 1 = "st", - is | 2 = "nd", - is | 3 = "rd", - is | _ = "th" + return match(day)( + is | in(11, 13) = "th", + is | (_ % 10 == 1) = "st", + is | (_ % 10 == 2) = "nd", + is | (_ % 10 == 3) = "rd", + is | _ = "th" ); }