Skip to content

Commit b40fa69

Browse files
committed
Keyframe::GetMaxPoint() simplify loop
1 parent 79cb848 commit b40fa69

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/KeyFrame.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,8 @@ Point Keyframe::GetPreviousPoint(Point p) const {
215215
Point Keyframe::GetMaxPoint() const {
216216
Point maxPoint(-1, -1);
217217

218-
// loop through points, and find the largest Y value
219-
for (int64_t x = 0; x < Points.size(); x++) {
220-
// Get each point
221-
Point existing_point = Points[x];
222-
223-
// Is point larger than max point
218+
for (Point const & existing_point: Points) {
224219
if (existing_point.co.Y >= maxPoint.co.Y) {
225-
// New max point found
226220
maxPoint = existing_point;
227221
}
228222
}

0 commit comments

Comments
 (0)