79385109

Date: 2025-01-24 17:14:00
Score: 2
Natty:
Report link

range based for-loops may be syntax sugar but they help get the performance:

const auto end_ = a_container.end(); for (auto i = a_container.begin(); i != end_; ++i) { ... }

vs

for (auto i = a_container.begin(); i != a_container.end(); ++i) { ... } //reevaluate end() for each iteration

Reasons:
  • Low length (0.5):
  • No code block (0.5):
  • Low reputation (1):
Posted by: jaybird