You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Keyframe::GetMaxPoint() simplify loop
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user