Commit 3407a59a authored by Lioncache's avatar Lioncache

CIntElement: Simplify CIEKeyframeEmitter's GetMaxValue()

We can just use std::max_element here to collapse the loop into an
assignment.
parent af0c2c41
#include "Runtime/Particle/CIntElement.hpp"
#include <algorithm>
#include "Runtime/CRandom16.hpp"
#include "Runtime/Particle/CElementGen.hpp"
#include "Runtime/Particle/CGenDescription.hpp"
......@@ -52,11 +54,7 @@ bool CIEKeyframeEmitter::GetValue(int frame, int& valOut) const {
}
int CIEKeyframeEmitter::GetMaxValue() const {
int maxVal = INT_MIN;
for (int k : x18_keys)
if (k > maxVal)
maxVal = k;
return maxVal;
return *std::max_element(x18_keys.cbegin(), x18_keys.cend());
}
bool CIEDeath::GetValue(int frame, int& valOut) const {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment