3 ms·
Which works in *most* cases. I forget the details but I do recall running into a case where it was griping erroneously (it couldn't reach the use without havin
by LorenPechtel 4y ago
Which works in *most* cases. I forget the details but I do recall running into a case where it was griping erroneously (it couldn't reach the use without having reached the initialization) so I gave it a harmless initial value--and it turned around and complained (correctly) that the assignment would never be used. I insist on removing all such warnings so I ended up restructuring the code so the compiler wouldn't get confused.
(Fundamentally, this was a case of a child operation that *might* be needed. It could have been rewritten polymorphically but that would have involved a fair amount of refactoring.)
- pjmlp 4y agoDeclare the variable closer to its definition point. Also such kind of situations are usually a sign that code blocks should be moved into a separate function.