diff options
| author | Pierre Bourdon <delroth@gmail.com> | 2014-02-04 16:40:25 -0800 |
|---|---|---|
| committer | Pierre Bourdon <delroth@gmail.com> | 2014-02-04 16:40:25 -0800 |
| commit | 59e2179172a5881cb53b2048cc01ae1f52b0b703 (patch) | |
| tree | ba0cad24e81eb42d292642b7d73bfc2187adc5db /Source/Core/VideoCommon/Statistics.cpp | |
| parent | 3ca1d0fce14afee91751320a1ec0f91ed8c2b1d2 (diff) | |
| parent | 6d9cd07bb9acd901fb12dd2445f15f2516bc4021 (diff) | |
Merge pull request #35 from lioncash/videocommons-kill-xchg-in-statistics
[VideoCommon] Eliminate the function Xchg in Statistics.cpp. std::swap does the same thing.
Diffstat (limited to 'Source/Core/VideoCommon/Statistics.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/Statistics.cpp | 17 |
1 files 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 <string.h> +#include <utility> #include "Statistics.h" #include "VertexLoaderManager.h" Statistics stats; -template <class T> -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) |
