From 6d9cd07bb9acd901fb12dd2445f15f2516bc4021 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 4 Feb 2014 19:35:27 -0500 Subject: [PATCH] [VideoCommon] Eliminate the function Xchg in Statistics.cpp. std::swap does the same thing. --- Source/Core/VideoCommon/Statistics.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/Source/Core/VideoCommon/Statistics.cpp b/Source/Core/VideoCommon/Statistics.cpp index 0c69499355..81219201bc 100644 --- a/Source/Core/VideoCommon/Statistics.cpp +++ b/Source/Core/VideoCommon/Statistics.cpp @@ -3,20 +3,13 @@ // Refer to the license.txt file included. #include +#include #include "Statistics.h" #include "VertexLoaderManager.h" Statistics stats; -template -void Xchg(T& a, T&b) -{ - T c = a; - a = b; - b = c; -} - void Statistics::ResetFrame() { memset(&thisFrame, 0, sizeof(ThisFrame)); @@ -24,10 +17,10 @@ void Statistics::ResetFrame() void Statistics::SwapDL() { - Xchg(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims); - Xchg(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads); - Xchg(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads); - Xchg(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads); + std::swap(stats.thisFrame.numDLPrims, stats.thisFrame.numPrims); + std::swap(stats.thisFrame.numXFLoadsInDL, stats.thisFrame.numXFLoads); + std::swap(stats.thisFrame.numCPLoadsInDL, stats.thisFrame.numCPLoads); + std::swap(stats.thisFrame.numBPLoadsInDL, stats.thisFrame.numBPLoads); } char *Statistics::ToString(char *ptr)