hints

ะก++ Hints

Within the scope of this project, we publish 1 recommendation/tip on C and C++ programming every day, these tips containing concentrated information on techniques of using the C/C++ language in various situations, and including examples of incorrect and correct use from more than 200 open-source projects we have scanned.

C++ Hints

by PVS-Studio Team

From the hint:

Although the code is neat and easy-to-read, it didn't prevent the developers from overlooking the error. You can't stay focused when reading code like that because all you see is just similarly looking blocks and you can't help just quickly scanning through them. These similar blocks have most likely resulted from the programmer's desire to optimize the code as much as possible. He or she just "unrolled the loop" manually. I don't think it was a good idea in this case.