Skip to content

Commit 63a7bf3

Browse files
committed
gpl: simplify with std::ranges::count_if
Signed-off-by: Matt Liberty <[email protected]>
1 parent 1789c9c commit 63a7bf3

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/gpl/src/placerBase.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -830,15 +830,9 @@ void PlacerBaseCommon::init()
830830

831831
// Extending instances by average pin density.
832832
auto count_signal_pins = [](const Instance& inst) -> int {
833-
int pin_count = 0;
834-
for (odb::dbITerm* iterm : inst.dbInst()->getITerms()) {
835-
odb::dbSigType sig_type = iterm->getSigType();
836-
if (sig_type != odb::dbSigType::POWER
837-
&& sig_type != odb::dbSigType::GROUND) {
838-
++pin_count;
839-
}
840-
}
841-
return pin_count;
833+
return std::ranges::count_if(
834+
inst.dbInst()->getITerms(),
835+
[](odb::dbITerm* iterm) { return !iterm->getSigType().isSupply(); });
842836
};
843837

844838
int total_signal_pins = 0;

0 commit comments

Comments
 (0)