Files
clang-p2996/lldb/source/Plugins/Platform/Android
Shivam Gupta a18f45f556 [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>
2024-07-11 12:57:50 +05:30
..