Skip to content

Commit a831f96

Browse files
committed
odb: clang-tidy requested changes
Signed-off-by: osamahammad21 <[email protected]>
1 parent 18df0cf commit a831f96

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/odb/src/3dblox/checker.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace odb {
1717

1818
std::string UnfoldedChip::getName() const
1919
{
20-
std::string name = "";
20+
std::string name;
2121
int index = 0;
2222
for (auto chip_inst : chip_inst_path) {
2323
name += chip_inst->getName();
@@ -54,7 +54,7 @@ void Checker::unfoldChip(odb::dbChipInst* chip_inst, UnfoldedChip unfolded_chip)
5454
} else {
5555
// calculate the cuboid of the chip
5656
unfolded_chip.cuboid = chip_inst->getMasterChip()->getCuboid();
57-
for (auto chip_inst : std::views::reverse(unfolded_chip.chip_inst_path)) {
57+
for (auto chip_inst : unfolded_chip.chip_inst_path | std::views::reverse) {
5858
chip_inst->getTransform().apply(unfolded_chip.cuboid);
5959
}
6060
debugPrint(
@@ -134,12 +134,11 @@ void Checker::checkFloatingChips(odb::dbMarkerCategory* category)
134134
insts_sets.emplace_back(chips);
135135
}
136136

137-
std::sort(insts_sets.begin(),
138-
insts_sets.end(),
139-
[](const std::vector<UnfoldedChip*>& a,
140-
const std::vector<UnfoldedChip*>& b) {
141-
return a.size() > b.size();
142-
});
137+
std::ranges::sort(insts_sets,
138+
[](const std::vector<UnfoldedChip*>& a,
139+
const std::vector<UnfoldedChip*>& b) {
140+
return a.size() > b.size();
141+
});
143142

144143
odb::dbMarkerCategory* floating_chips_category
145144
= odb::dbMarkerCategory::createOrReplace(category, "Floating chips");

src/odb/src/3dblox/checker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
#include <string>
4+
#include <vector>
45

56
#include "odb/3dblox.h"
67
#include "odb/geom.h"

0 commit comments

Comments
 (0)