Project

General

Profile

Actions

Cleanup #432

closed

use STL find() and iterators instead of count()

Added by Sage Weil over 13 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
-
Target version:
-
% Done:

0%

Tags:
Backport:
Reviewed:
Affected Versions:
Pull request ID:

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.
Actions #1

Updated by Noah Watkins over 11 years ago

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.

Actions #2

Updated by Rishabh Kumar over 7 years ago

Hi. I wish to do this major cleanup. I will break it down into a series of commits depending on the subdirectories.

Actions #3

Updated by Greg Farnum over 7 years ago

+1 :)

Actions #4

Updated by Jos Collin over 6 years ago

  • Assignee set to Amit Kumar
Actions #5

Updated by Patrick Donnelly about 5 years ago

  • Status changed from New to Closed

Closing this, there's a never-ending stream of these.

Actions

Also available in: Atom PDF