blob: d342bf377eb108ea1a65d869590f225ca36dc198 [file] [log] [blame]
.. title:: clang-tidy - abseil-redundant-strcat-calls
Suggests removal of unnecessary calls to ``absl::StrCat`` when the result is
being passed to another call to ``absl::StrCat`` or ``absl::StrAppend``.
The extra calls cause unnecessary temporary strings to be constructed. Removing
them makes the code smaller and faster.
.. code-block:: c++
std::string s = absl::StrCat("A", absl::StrCat("B", absl::StrCat("C", "D")));
std::string s = absl::StrCat("A", "B", "C", "D");
absl::StrAppend(&s, absl::StrCat("E", "F", "G"));
absl::StrAppend(&s, "E", "F", "G");