Cleanup #432
closed
use STL find() and iterators instead of count()
Added by Sage Weil over 13 years ago.
Updated about 5 years ago.
Description
There are 100 million instances of code like
if (container.count(foo))
return container[foo];
or similar. We should be using iterators so that the hashes/maps don't need to be traversed twice.
The semantic patch tool Coccinelle has an open issue for supporting C++. Something to keep an eye out for, and would probably be perfect for this task.
Hi. I wish to do this major cleanup. I will break it down into a series of commits depending on the subdirectories.
- Assignee set to Amit Kumar
- Status changed from New to Closed
Closing this, there's a never-ending stream of these.
Also available in: Atom
PDF