Merge pull request #3187 from lioncash/accum
FifoAnalyzer: Replace loop with std::accumulate
This commit is contained in:
commit
9154347f5b
|
@ -2,6 +2,8 @@
|
||||||
// Licensed under GPLv2+
|
// Licensed under GPLv2+
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
#include "Common/Assert.h"
|
#include "Common/Assert.h"
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
#include "Core/Core.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 CalculateVertexSize(int vatIndex, const CPMemory& cpMem)
|
||||||
{
|
{
|
||||||
u32 vertexSize = 0;
|
|
||||||
|
|
||||||
int sizes[21];
|
int sizes[21];
|
||||||
CalculateVertexElementSizes(sizes, vatIndex, cpMem);
|
CalculateVertexElementSizes(sizes, vatIndex, cpMem);
|
||||||
|
|
||||||
for (auto& size : sizes)
|
return std::accumulate(std::begin(sizes), std::end(sizes), 0U);
|
||||||
vertexSize += size;
|
|
||||||
|
|
||||||
return vertexSize;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory& cpMem)
|
void CalculateVertexElementSizes(int sizes[], int vatIndex, const CPMemory& cpMem)
|
||||||
|
|
Loading…
Reference in New Issue