From b40fa6922e0c4b9ac78527db14cc77ed21f082b1 Mon Sep 17 00:00:00 2001 From: Daniel Jour Date: Tue, 3 Dec 2019 16:58:53 +0100 Subject: [PATCH] Keyframe::GetMaxPoint() simplify loop --- src/KeyFrame.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/KeyFrame.cpp b/src/KeyFrame.cpp index 68ea1ef1..8982f29d 100644 --- a/src/KeyFrame.cpp +++ b/src/KeyFrame.cpp @@ -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; } }