@ -9613,7 +9613,7 @@ not. Unfortunately, it may be impossible to detect when a non-`const` was not
##### Reason
Readability.
Readability and safety.
##### Example, bad
@ -9624,6 +9624,26 @@ Readability.
for (i = 0; i <200;++i){/*...*/}//bad:irecycled
}
##### Note
As an optimization, you may want to reuse a buffer as a scratchpad, but even then prefer to limit the variables's scope as much as possible and be careful not to cause bugs from data left in a recycled buffer as this is a common source of security bugs.
{
std::string buffer; // to avoid reallocations on every loop iteration