aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
authorXu Jun <jun1.xu@intel.com>2021-11-01 22:14:48 -0700
committerWalter Erquinigo <wallace@fb.com>2021-11-01 22:15:01 -0700
commitdfd499a61c45778b7f01458d50ccc384343f53d5 (patch)
treead6b7d37e22fe864bb137c8c7aea290594dbb6f4 /lldb/source/Commands/CommandObjectTarget.cpp
parentfe19ae352ce201e7bab8baac4587cc4334e742e4 (diff)
downloadllvm-dfd499a61c45778b7f01458d50ccc384343f53d5.zip
llvm-dfd499a61c45778b7f01458d50ccc384343f53d5.tar.gz
llvm-dfd499a61c45778b7f01458d50ccc384343f53d5.tar.bz2
[lldb][NFC] avoid unnecessary roundtrips between different string types
The amount of roundtrips between StringRefs, ConstStrings and std::strings is getting a bit out of hand, this patch avoid the unnecessary roundtrips. Reviewed By: wallace, aprantl Differential Revision: https://reviews.llvm.org/D112863
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index e0a88a7..2a42eb2 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -1047,8 +1047,7 @@ protected:
}
bool last_pair = ((argc - i) == 2);
target->GetImageSearchPathList().Append(
- ConstString(from), ConstString(to),
- last_pair); // Notify if this is the last pair
+ from, to, last_pair); // Notify if this is the last pair
result.SetStatus(eReturnStatusSuccessFinishNoResult);
} else {
if (from[0])
@@ -1175,8 +1174,8 @@ protected:
if (from[0] && to[0]) {
bool last_pair = ((argc - i) == 2);
- target->GetImageSearchPathList().Insert(
- ConstString(from), ConstString(to), insert_idx, last_pair);
+ target->GetImageSearchPathList().Insert(from, to, insert_idx,
+ last_pair);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
} else {
if (from[0])