Fix more clang-tidy issues

This commit is contained in:
Robert Haschke 2021-04-24 01:38:12 +02:00
parent 4fa8c10f44
commit cfcb1f274e
6 changed files with 10 additions and 11 deletions

View File

@ -1,6 +1,5 @@
---
Checks: '-*,
performance-*,
Checks: 'performance-*,
llvm-namespace-comment,
modernize-redundant-void-arg,
modernize-use-nullptr,

View File

@ -462,15 +462,14 @@ void SerialContainer::onNewSolution(const SolutionBase& current) {
// collect (and sort) all solutions spanning from start to end of this container
ordered<SolutionSequencePtr> sorted;
SolutionSequence::container_type solution;
solution.reserve(children.size());
for (auto& in : incoming.solutions) {
for (auto& out : outgoing.solutions) {
InterfaceState::Priority prio = in.second + InterfaceState::Priority(1u, current.cost()) + out.second;
assert(prio.enabled());
// found a complete solution path connecting start to end?
if (prio.depth() == children.size()) {
assert(solution.empty());
SolutionSequence::container_type solution;
solution.reserve(children.size());
// insert incoming solutions in reverse order
solution.insert(solution.end(), in.first.rbegin(), in.first.rend());
// insert current solution

View File

@ -74,7 +74,7 @@ bool JointInterpolationPlanner::plan(const planning_scene::PlanningSceneConstPtr
moveit::core::RobotState waypoint(from_state);
double delta = d < 1e-6 ? 1.0 : props.get<double>("max_step") / d;
for (double t = delta; t < 1.0; t += delta) {
for (double t = delta; t < 1.0; t += delta) { // NOLINT(clang-analyzer-security.FloatLoopCounter)
from_state.interpolate(to_state, t, waypoint);
result->addSuffixWayPoint(waypoint, t);

View File

@ -172,12 +172,12 @@ TEST(ContainerBase, positionForInsert) {
/* TODO: remove interface as it returns raw pointers */
TEST(ContainerBase, findChild) {
SerialContainer s, *c2;
SerialContainer s;
Stage *a, *b, *c1, *d;
s.add(Stage::pointer(a = new NamedStage("a")));
s.add(Stage::pointer(b = new NamedStage("b")));
s.add(Stage::pointer(c1 = new NamedStage("c")));
auto sub = ContainerBase::pointer(c2 = new SerialContainer("c"));
auto sub = ContainerBase::pointer(new SerialContainer("c"));
sub->add(Stage::pointer(d = new NamedStage("d")));
s.add(std::move(sub));
@ -678,11 +678,11 @@ TEST(Task, move) {
MOCK_ID = 0;
Task t2 = std::move(t1);
EXPECT_EQ(t2.stages()->numChildren(), 2u);
EXPECT_EQ(t1.stages()->numChildren(), 0u);
EXPECT_EQ(t1.stages()->numChildren(), 0u); // NOLINT(clang-analyzer-cplusplus.Move)
t1 = std::move(t2);
EXPECT_EQ(t1.stages()->numChildren(), 2u);
EXPECT_EQ(t2.stages()->numChildren(), 0u);
EXPECT_EQ(t2.stages()->numChildren(), 0u); // NOLINT(clang-analyzer-cplusplus.Move)
}
TEST(Task, reuse) {

View File

@ -64,7 +64,7 @@ class SubPanel : public QWidget
public:
SubPanel(QWidget* parent = nullptr) : QWidget(parent) {}
virtual void save(rviz::Config config) {}
virtual void save(rviz::Config config) {} // NOLINT(performance-unnecessary-value-param)
virtual void load(const rviz::Config& config) {}
Q_SIGNALS:

View File

@ -82,6 +82,7 @@ public:
void configureTaskListModel(TaskListModel* model);
/// configure all TaskListModels that were already created when TaskView gets instantiated
void configureExistingModels();
// NOLINTNEXTLINE(readability-identifier-naming)
/// configure newly inserted models
void _q_configureInsertedModels(const QModelIndex& parent, int first, int last);