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

Refactor some variable shadowing #377

Closed weshinsley closed 4 years ago

weshinsley commented 4 years ago

This removes some variable shadowing observed in #169 and #188 - variable j is reused, the first one sharing the outer loop j, and two more that declare a new scoped j.

There may be further ways to clean this up, and make it more clear in due course; for now I have only tried to make explicit what was previously happening (namely, exit value of j from the first loop being set).

From discussions, there is no code issue here, just clarity.

dlaydon commented 4 years ago

Looks good @weshinsley and thanks for fixing, just going to wait for checks to pass.