@@ -623,12 +623,14 @@ class frLayer
623623 {
624624 // This vector should be sorted by area in a descending order
625625 auto area = in->getODBRule ()->getArea ();
626- auto it = std::lower_bound (lef58AreaConstraints_.begin (),
627- lef58AreaConstraints_.end (),
628- area,
629- [](const frLef58AreaConstraint* a, frCoord b) {
630- return a->getODBRule ()->getArea () > b;
631- });
626+ auto it = std::ranges::lower_bound (
627+ lef58AreaConstraints_.begin (),
628+ lef58AreaConstraints_.end (),
629+ area,
630+ std::ranges::greater{},
631+ [](const frLef58AreaConstraint* a) {
632+ return a->getODBRule ()->getArea ();
633+ });
632634 lef58AreaConstraints_.insert (it, in);
633635 }
634636
@@ -647,12 +649,14 @@ class frLayer
647649 {
648650 // This vector should be sorted by rectwidth in an ascending order
649651 auto rectwidth = in->getODBRule ()->getRectWidth ();
650- auto it = std::lower_bound (lef58AreaConstraintsRectWidth_.begin (),
651- lef58AreaConstraintsRectWidth_.end (),
652- rectwidth,
653- [](const frLef58AreaConstraint* a, frCoord b) {
654- return a->getODBRule ()->getRectWidth () < b;
655- });
652+ auto it = std::ranges::lower_bound (
653+ lef58AreaConstraintsRectWidth_.begin (),
654+ lef58AreaConstraintsRectWidth_.end (),
655+ rectwidth,
656+ std::ranges::less{},
657+ [](const frLef58AreaConstraint* a) {
658+ return a->getODBRule ()->getRectWidth ();
659+ });
656660 lef58AreaConstraintsRectWidth_.insert (it, in);
657661 }
658662
0 commit comments