Index: clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-vector-operation.rst =================================================================== --- clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-vector-operation.rst +++ clang-tools-extra/docs/clang-tidy/checks/performance-inefficient-vector-operation.rst @@ -6,9 +6,9 @@ Finds possible inefficient ``std::vector`` operations (e.g. ``push_back``, ``emplace_back``) that may cause unnecessary memory reallocations. -When EnableProto, also finds calls that add element to protobuf repeated field -in a loop without calling Reserve() before the loop. Calling Reserve() first -can avoid unnecessary memory reallocations. +It can also find calls that add element to protobuf repeated field in a loop +without calling Reserve() before the loop. Calling Reserve() first can avoid +unnecessary memory reallocations. Currently, the check only detects following kinds of loops with a single statement body: @@ -58,3 +58,8 @@ Semicolon-separated list of names of vector-like classes. By default only ``::std::vector`` is considered. + +.. option:: EnableProto + When non-zero, the check will also warn on inefficient operations for proto + repeated fields. Otherwise, the check only warns on inefficient vector + operations. Default is `0`.