rjhogan / Adept-2

Combined array and automatic differentiation library in C++
http://www.met.reading.ac.uk/clouds/adept/
Apache License 2.0
163 stars 29 forks source link

Remove dead code line #20

Closed yairchu closed 3 years ago

yairchu commented 3 years ago

The removed modification of i_independent happens at the end of the scope where i_independent is defined, so has no effect.

The line seems to assume that i_independent was defined outside of the loop and is maintained in it to be MULTIPASS_SIZE * iblock, which may have been the case at some point, but the code currently defines it in the beginning of the loop's scope to be this value. Note that after removing this line it can be defined with const to signify that its value is always such.

(btw, Xcode analyzer pointed me to this issue)

rjhogan commented 3 years ago

Thanks! Accepted.