File tree Expand file tree Collapse file tree 1 file changed +9
-13
lines changed
Expand file tree Collapse file tree 1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -34,8 +34,6 @@ namespace tesseract {
3434
3535#define INTERSECTING INT16_MAX
3636
37- int lessthan (const ICOORDELT *first, const ICOORDELT *second);
38-
3937POLY_BLOCK::POLY_BLOCK (ICOORDELT_LIST *points, PolyBlockType t) {
4038 ICOORDELT_IT v = &vertices;
4139
@@ -357,7 +355,15 @@ ICOORDELT_LIST *PB_LINE_IT::get_line(TDimension y) {
357355 }
358356
359357 if (!r.empty ()) {
360- r.sort (lessthan);
358+ r.sort ([](const ICOORDELT *p1, const ICOORDELT *p2) {
359+ if (p1->x () < p2->x ()) {
360+ return (-1 );
361+ } else if (p1->x () > p2->x ()) {
362+ return (1 );
363+ } else {
364+ return (0 );
365+ }
366+ });
361367 for (r.mark_cycle_pt (); !r.cycled_list (); r.forward ()) {
362368 x = r.data ();
363369 }
@@ -371,16 +377,6 @@ ICOORDELT_LIST *PB_LINE_IT::get_line(TDimension y) {
371377 return result;
372378}
373379
374- int lessthan (const ICOORDELT *p1, const ICOORDELT *p2) {
375- if (p1->x () < p2->x ()) {
376- return (-1 );
377- } else if (p1->x () > p2->x ()) {
378- return (1 );
379- } else {
380- return (0 );
381- }
382- }
383-
384380#ifndef GRAPHICS_DISABLED
385381// / Returns a color to draw the given type.
386382ScrollView::Color POLY_BLOCK::ColorForPolyBlockType (PolyBlockType type) {
You can’t perform that action at this time.
0 commit comments