Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

30 lines
653 B
ReStructuredText

.. title:: clang-tidy - performance-inefficient-algorithm
performance-inefficient-algorithm
=================================
Warns on inefficient use of STL algorithms on associative containers.
Associative containers implements some of the algorithms as methods which
should be preferred to the algorithms in the algorithm header. The methods
can take advanatage of the order of the elements.
.. code-block:: c++
std::set<int> s;
auto it = std::find(s.begin(), s.end(), 43);
// becomes
auto it = s.find(43);
.. code-block:: c++
std::set<int> s;
auto c = std::count(s.begin(), s.end(), 43);
// becomes
auto c = s.count(43);