File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change @@ -114,20 +114,9 @@ int64_t Keyframe::FindIndex(Point p) const {
114114
115115// Determine if point already exists
116116bool Keyframe::Contains (Point p) const {
117- // loop through points, and find a matching coordinate
118- for (int64_t x = 0 ; x < Points.size (); x++) {
119- // Get each point
120- Point existing_point = Points[x];
121-
122- // find a match
123- if (p.co .X == existing_point.co .X ) {
124- // Remove the matching point, and break out of loop
125- return true ;
126- }
127- }
128-
129- // no matching point found
130- return false ;
117+ std::vector<Point>::const_iterator i =
118+ std::lower_bound (begin (Points), end (Points), p.co .X , IsPointBeforeX);
119+ return i != end (Points) && i->co .X == p.co .X ;
131120}
132121
133122// Get current point (or closest point) from the X coordinate (i.e. the frame number)
You can’t perform that action at this time.
0 commit comments