diff options
| author | Shivam Gupta <shivam98.tkg@gmail.com> | 2024-07-11 12:57:50 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-11 12:57:50 +0530 |
| commit | a18f45f556c781d711f82043bf451fcce8324163 (patch) | |
| tree | 8bdd2d86ac280c5b526d8159bafcd836ab447c7b /lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h | |
| parent | 6a907699d8b4fb35a843ab8fd84ca56ed93fc201 (diff) | |
| download | llvm-a18f45f556c781d711f82043bf451fcce8324163.zip llvm-a18f45f556c781d711f82043bf451fcce8324163.tar.gz llvm-a18f45f556c781d711f82043bf451fcce8324163.tar.bz2 | |
[lldb] Fix string truncation method when substring is the prefix of string (NFC) (#94785)
Correct the method used to truncate the source_file string when
substring is a prefix. The previous method used substr, which was
changed to resize for clarity and efficiency.
Caught by cppcheck -
lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp:290:19:
performance: Ineffective call of function 'substr' because a prefix of
the string is assigned to itself. Use resize() or pop_back() instead.
[uselessCallsSubstr]
Source code -
source_file = source_file.substr(0, pos);
Fix #91211
---------
Co-authored-by: Shivam Gupta <shivma98.tkg@gmail.com>
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/JSON/ObjectFileJSON.h')
0 files changed, 0 insertions, 0 deletions
