[Lldb-commits] [lldb] 67c937f - [lldb] Use std::move in StringList (NFC)
Dave Lee via lldb-commits
lldb-commits at lists.llvm.org
Mon Jan 3 15:36:28 PST 2022
Author: Dave Lee
Date: 2022-01-03T15:36:19-08:00
New Revision: 67c937f846b18e3113e126c37c69a222c0e99c1c
URL: https://github.com/llvm/llvm-project/commit/67c937f846b18e3113e126c37c69a222c0e99c1c
DIFF: https://github.com/llvm/llvm-project/commit/67c937f846b18e3113e126c37c69a222c0e99c1c.diff
LOG: [lldb] Use std::move in StringList (NFC)
Added:
Modified:
lldb/source/Utility/StringList.cpp
Removed:
################################################################################
diff --git a/lldb/source/Utility/StringList.cpp b/lldb/source/Utility/StringList.cpp
index baff34ae3a5ef..f78681c05a3d7 100644
--- a/lldb/source/Utility/StringList.cpp
+++ b/lldb/source/Utility/StringList.cpp
@@ -42,7 +42,9 @@ void StringList::AppendString(const char *str) {
void StringList::AppendString(const std::string &s) { m_strings.push_back(s); }
-void StringList::AppendString(std::string &&s) { m_strings.push_back(s); }
+void StringList::AppendString(std::string &&s) {
+ m_strings.push_back(std::move(s));
+}
void StringList::AppendString(const char *str, size_t str_len) {
if (str)
@@ -133,9 +135,9 @@ void StringList::InsertStringAtIndex(size_t idx, const std::string &str) {
void StringList::InsertStringAtIndex(size_t idx, std::string &&str) {
if (idx < m_strings.size())
- m_strings.insert(m_strings.begin() + idx, str);
+ m_strings.insert(m_strings.begin() + idx, std::move(str));
else
- m_strings.push_back(str);
+ m_strings.push_back(std::move(str));
}
void StringList::DeleteStringAtIndex(size_t idx) {
More information about the lldb-commits
mailing list