[all-commits] [llvm/llvm-project] d3fc5c: [lldb] Remove redundant c_str() calls in stream ou...

Shivam Gupta via All-commits all-commits at lists.llvm.org
Fri Jun 7 23:32:23 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d3fc5cf24a93003ba963fc406aa1901a292d55f4
      https://github.com/llvm/llvm-project/commit/d3fc5cf24a93003ba963fc406aa1901a292d55f4
  Author: Shivam Gupta <shivam98.tkg at gmail.com>
  Date:   2024-06-08 (Sat, 08 Jun 2024)

  Changed paths:
    M lldb/tools/debugserver/source/JSON.cpp

  Log Message:
  -----------
  [lldb] Remove redundant c_str() calls in stream output (NFC) (#94839)

Passing the result of c_str() to a stream is slow and redundant. This
change removes unnecessary c_str() calls and uses the string object
directly.

Caught by cppcheck -
lldb/tools/debugserver/source/JSON.cpp:398:19: performance: Passing the
result of c_str() to a stream is slow and redundant. [stlcstrStream]
lldb/tools/debugserver/source/JSON.cpp:408:64: performance: Passing the
result of c_str() to a stream is slow and redundant. [stlcstrStream]
lldb/tools/debugserver/source/JSON.cpp:420:54: performance: Passing the
result of c_str() to a stream is slow and redundant. [stlcstrStream]
lldb/tools/debugserver/source/JSON.cpp:46:13: performance: Passing the
result of c_str() to a stream is slow and redundant. [stlcstrStream]

Fix #91212



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list