mrc-ide / covid-sim

This is the COVID-19 CovidSim microsimulation model developed by the MRC Centre for Global Infectious Disease Analysis hosted at Imperial College, London.
GNU General Public License v3.0
1.23k stars 256 forks source link

Replace counter assignment with breaks #412

Closed zlatanvasovic closed 4 years ago

zlatanvasovic commented 4 years ago

In the second example goto would be more idiomatic. In the first it's clear since there is only one loop. I found the current syntax very confusing, as I had to re-check the initial loop conditions to see that it'd end.

The way that I proposed it the loop ends directly, instead of changing a variable and then checking its value to end the loop.

zlatanvasovic commented 4 years ago

@matt-gretton-dann I'm missing something. In what way is that PR related to this? The lines that I changed here are untouched in it.

ozmorph commented 4 years ago

@matt-gretton-dann I'm missing something. In what way is that PR related to this? The lines that I changed here are untouched in it.

They may have accidentally been referring to my other PR #346 which (once complete) will remove the specified function entirely.