blob: 6db321a06243fc5624dfcd897c80506555f4c8c1 [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");