From 56d8007d46af8bdff82d05049593816424516eb0 Mon Sep 17 00:00:00 2001 From: Joshua Coles Date: Mon, 20 Feb 2023 20:56:10 +0000 Subject: [PATCH] Make clang-tidy a little happier --- DLASystem.cpp | 12 ++---------- DLASystem.h | 6 +++--- 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/DLASystem.cpp b/DLASystem.cpp index ae35c41..f4e6299 100644 --- a/DLASystem.cpp +++ b/DLASystem.cpp @@ -38,7 +38,7 @@ int DLASystem::readGrid(std::array pos) { // add a particle to the system at a specific position void DLASystem::addParticle(std::array pos) { // create a new particle - Particle *p = new Particle(pos); + auto *p = new Particle(pos); // push_back means "add this to the end of the list" particleList.push_back(p); @@ -144,7 +144,7 @@ int DLASystem::checkStick() { int result = 0; // loop over neighbours for (int i = 0; i < 4; i++) { - std::array checkpos; + std::array checkpos{}; setPosNeighbour(checkpos, lastP->pos, i); // if the neighbour is occupied... if (readGrid(checkpos) == 1) @@ -169,14 +169,6 @@ DLASystem::DLASystem(Config config) /* * Handle grid data structure. * */ - -// // set the grid to zero -// for (int i = 0; i < gridSize; i++) { -// for (int j = 0; j < gridSize; j++) { -// grid[i][j] = 0; -// } -// } - // Add particle to the centre of the grid to start std::array pos{0.0, 0.0}; addParticle(pos); diff --git a/DLASystem.h b/DLASystem.h index 3897383..0e2c4af 100644 --- a/DLASystem.h +++ b/DLASystem.h @@ -2,12 +2,12 @@ #include #include -#include +#include #include #define _USE_MATH_DEFINES -#include +#include #include #include #include @@ -81,7 +81,7 @@ public: int lastParticleIsActive; // constructor - DLASystem(Config config); + explicit DLASystem(Config config); // destructor ~DLASystem();