Skip to content

Commit

Permalink
[lldb] Use std::move in StringList (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kastiglione committed Jan 3, 2022
1 parent c343c20 commit 67c937f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lldb/source/Utility/StringList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 67c937f

Please sign in to comment.