From 0c433f3d428b8a00986f6d5abe07b0efb666e253 Mon Sep 17 00:00:00 2001 From: Dale Whinham Date: Sat, 26 Jun 2021 17:01:45 +0100 Subject: [PATCH] Minor cleanups in utility --- include/utility.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/include/utility.h b/include/utility.h index f87feb6..d34e4e6 100644 --- a/include/utility.h +++ b/include/utility.h @@ -109,31 +109,31 @@ namespace Utility using TComparator = bool (*)(const T&, const T&); template - inline bool LessThan(const T& lhs, const T& rhs) + inline bool LessThan(const T& ObjectA, const T& ObjectB) { - return lhs < rhs; + return ObjectA < ObjectB; } template - inline bool GreaterThan(const T& ItemA, const T& ItemB) + inline bool GreaterThan(const T& ObjectA, const T& ObjectB) { - return ItemA > ItemB; + return ObjectA > ObjectB; } - inline bool CaseInsensitiveAscending(const CString& lhs, const CString& rhs) + inline bool CaseInsensitiveAscending(const CString& StringA, const CString& StringB) { - return strcasecmp(lhs, rhs) < 0; + return strcasecmp(StringA, StringB) < 0; } } // Swaps two objects in-place template - inline void Swap(T& lhs, T& rhs) + inline void Swap(T& ObjectA, T& ObjectB) { - u8 temp[sizeof(T)]; - memcpy(temp, &lhs, sizeof(T)); - memcpy(&lhs, &rhs, sizeof(T)); - memcpy(&rhs, temp, sizeof(T)); + u8 Buffer[sizeof(T)]; + memcpy(Buffer, &ObjectA, sizeof(T)); + memcpy(&ObjectA, &ObjectB, sizeof(T)); + memcpy(&ObjectB, Buffer, sizeof(T)); } namespace