Make clang-tidy a little happier

This commit is contained in:
Joshua Coles 2023-02-20 20:56:10 +00:00
parent 9f34807269
commit 56d8007d46
2 changed files with 5 additions and 13 deletions

View File

@ -38,7 +38,7 @@ int DLASystem::readGrid(std::array<double, 2> pos) {
// add a particle to the system at a specific position // add a particle to the system at a specific position
void DLASystem::addParticle(std::array<double, 2> pos) { void DLASystem::addParticle(std::array<double, 2> pos) {
// create a new particle // 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" // push_back means "add this to the end of the list"
particleList.push_back(p); particleList.push_back(p);
@ -144,7 +144,7 @@ int DLASystem::checkStick() {
int result = 0; int result = 0;
// loop over neighbours // loop over neighbours
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
std::array<double, 2> checkpos; std::array<double, 2> checkpos{};
setPosNeighbour(checkpos, lastP->pos, i); setPosNeighbour(checkpos, lastP->pos, i);
// if the neighbour is occupied... // if the neighbour is occupied...
if (readGrid(checkpos) == 1) if (readGrid(checkpos) == 1)
@ -169,14 +169,6 @@ DLASystem::DLASystem(Config config)
/* /*
* Handle grid data structure. * 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 // Add particle to the centre of the grid to start
std::array<double, 2> pos{0.0, 0.0}; std::array<double, 2> pos{0.0, 0.0};
addParticle(pos); addParticle(pos);

View File

@ -2,12 +2,12 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <stdio.h> #include <cstdio>
#include <vector> #include <vector>
#define _USE_MATH_DEFINES #define _USE_MATH_DEFINES
#include <math.h> #include <cmath>
#include <random> #include <random>
#include <string> #include <string>
#include <sstream> #include <sstream>
@ -81,7 +81,7 @@ public:
int lastParticleIsActive; int lastParticleIsActive;
// constructor // constructor
DLASystem(Config config); explicit DLASystem(Config config);
// destructor // destructor
~DLASystem(); ~DLASystem();