rspec/rules/S1854/description.adoc

2 lines
344 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
A dead store happens when a local variable is assigned a value that is not read by any subsequent instruction. Calculating or retrieving a value only to then overwrite it or throw it away, could indicate a serious error in the code. Even if it's not an error, it is at best a waste of resources. Therefore all calculated values should be used.