Skip to content

Commit

Permalink
Keyframe::GetMaxPoint() simplify loop
Browse files Browse the repository at this point in the history
  • Loading branch information
musteresel committed Dec 3, 2019
1 parent 79cb848 commit b40fa69
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/KeyFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit b40fa69

Please sign in to comment.