Keyframe::GetMaxPoint() simplify loop

This commit is contained in:
Daniel Jour
2019-12-03 16:58:53 +01:00
parent 79cb8483f3
commit b40fa6922e

View File

@@ -215,14 +215,8 @@ Point Keyframe::GetPreviousPoint(Point p) const {
Point Keyframe::GetMaxPoint() const {
Point maxPoint(-1, -1);
// loop through points, and find the largest Y value
for (int64_t x = 0; x < Points.size(); x++) {
// Get each point
Point existing_point = Points[x];
// Is point larger than max point
for (Point const & existing_point: Points) {
if (existing_point.co.Y >= maxPoint.co.Y) {
// New max point found
maxPoint = existing_point;
}
}