Skip to content

Commit c47edda

Browse files
committed
Minor performance improvement
1 parent ea91184 commit c47edda

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

SphWaterfall/SphWaterfall/src/simulation/SphManager.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ void SphManager::computeLocalDensity(SphParticle& particle) {
168168
for (auto& neighbour : neighbour_particles) {
169169
if (particle == neighbour.second.first) {
170170
neighbours = neighbour.second.second;
171+
break;
171172
}
172173
}
173174

@@ -189,6 +190,7 @@ Vector3 SphManager::computeDensityAcceleration(SphParticle& particle) {
189190
for (auto& neighbour : neighbour_particles) {
190191
if (particle == neighbour.second.first) {
191192
neighbours = neighbour.second.second;
193+
break;
192194
}
193195
}
194196

@@ -239,6 +241,7 @@ Vector3 SphManager::computeViscosityAcceleration(SphParticle& particle) {
239241
for (auto& neighbour : neighbour_particles) {
240242
if (particle == neighbour.second.first) {
241243
neighbours = neighbour.second.second;
244+
break;
242245
}
243246
}
244247

0 commit comments

Comments
 (0)