From 695ffefef76c49c93ed68e3ab6c0ff200d5f59ae Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 19 Oct 2015 10:29:00 -0400 Subject: [PATCH] FifoAnalyzer: Replace loop with std::accumulate --- Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp b/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp index 40cdcdf49e..e64c48f52e 100644 --- a/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp +++ b/Source/Core/Core/FifoPlayer/FifoAnalyzer.cpp @@ -2,6 +2,8 @@ // Licensed under GPLv2+ // Refer to the license.txt file included. +#include + #include "Common/Assert.h" #include "Core/ConfigManager.h" #include "Core/Core.h" @@ -109,15 +111,10 @@ void LoadCPReg(u32 subCmd, u32 value, CPMemory& cpMem) u32 CalculateVertexSize(int vatIndex, const CPMemory& cpMem) { - u32 vertexSize = 0; - int sizes[21]; CalculateVertexElementSizes(sizes, vatIndex, cpMem); - for (auto& size : sizes) - vertexSize += size; - - return vertexSize; + return std::accumulate(std::begin(sizes), std::end(sizes), 0U); } void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory& cpMem)