Skip to content

Commit 1609eb2

Browse files
author
Yong Bakos
committed
Refactoring unnecessary if statement.
1 parent ace9ef6 commit 1609eb2

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

  • java/examples/Topics/Simulate/MultipleParticleSystems

java/examples/Topics/Simulate/MultipleParticleSystems/Particle.pde

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,10 @@ class Particle {
3131
fill(255,lifespan);
3232
ellipse(location.x,location.y,8,8);
3333
}
34-
34+
3535
// Is the particle still useful?
3636
boolean isDead() {
37-
if (lifespan < 0.0) {
38-
return true;
39-
} else {
40-
return false;
41-
}
37+
return (lifespan < 0.0);
4238
}
43-
}
4439

40+
}

0 commit comments

Comments
 (0)