27 lines · plain
1.. title:: clang-tidy - abseil-redundant-strcat-calls2 3abseil-redundant-strcat-calls4=============================5 6Suggests removal of unnecessary calls to ``absl::StrCat`` when the result is7being passed to another call to ``absl::StrCat`` or ``absl::StrAppend``.8 9The extra calls cause unnecessary temporary strings to be constructed. Removing10them makes the code smaller and faster.11 12Examples:13 14.. code-block:: c++15 16 std::string s = absl::StrCat("A", absl::StrCat("B", absl::StrCat("C", "D")));17 //before18 19 std::string s = absl::StrCat("A", "B", "C", "D");20 //after21 22 absl::StrAppend(&s, absl::StrCat("E", "F", "G"));23 //before24 25 absl::StrAppend(&s, "E", "F", "G");26 //after27