From a9663669dc1037a04e37ae30efe18c0650547ac5 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 1 Jun 2019 07:55:09 -0400 Subject: Common/CommonFuncs: Remove now-unneccessary ArraySize function Since C++17, non-member std::size() is present in the standard library which also operates on regular C arrays. Given that, we can just replace usages of ArraySize with that where applicable. In many cases, we can just change the actual C array ArraySize() was called on into a std::array and just use its .size() member function instead. In some other cases, we can collapse the loops they were used in, into a ranged-for loop, eliminating the need for en explicit bounds query. --- Source/UnitTests/Common/CommonFuncsTest.cpp | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'Source/UnitTests/Common/CommonFuncsTest.cpp') diff --git a/Source/UnitTests/Common/CommonFuncsTest.cpp b/Source/UnitTests/Common/CommonFuncsTest.cpp index 6582eef1cc..8d6390dc75 100644 --- a/Source/UnitTests/Common/CommonFuncsTest.cpp +++ b/Source/UnitTests/Common/CommonFuncsTest.cpp @@ -6,18 +6,6 @@ #include "Common/CommonFuncs.h" -TEST(CommonFuncs, ArraySizeFunction) -{ - char test[4]; - u32 test2[42]; - - EXPECT_EQ(4u, ArraySize(test)); - EXPECT_EQ(42u, ArraySize(test2)); - - (void)test; - (void)test2; -} - TEST(CommonFuncs, CrashMacro) { EXPECT_DEATH({ Crash(); }, ""); -- cgit v1.2.3