llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT--> @llvm/pr-subscribers-lldb Author: Henry (sfu2) <details> <summary>Changes</summary> Eliminate redundant vector copies in StringList and its dependent classes. --- Full diff: https://github.com/llvm/llvm-project/pull/173779.diff 2 Files Affected: - (modified) lldb/include/lldb/Utility/StringList.h (+1-1) - (modified) lldb/source/Utility/StringList.cpp (+1-1) ``````````diff diff --git a/lldb/include/lldb/Utility/StringList.h b/lldb/include/lldb/Utility/StringList.h index 1357cf17173a4..bb3e18ba3c2dd 100644 --- a/lldb/include/lldb/Utility/StringList.h +++ b/lldb/include/lldb/Utility/StringList.h @@ -49,7 +49,7 @@ class StringList { void AppendList(const char **strv, int strc); - void AppendList(StringList strings); + void AppendList(const StringList &strings); size_t GetSize() const; diff --git a/lldb/source/Utility/StringList.cpp b/lldb/source/Utility/StringList.cpp index 98923a07db704..3c7c0c0471251 100644 --- a/lldb/source/Utility/StringList.cpp +++ b/lldb/source/Utility/StringList.cpp @@ -66,7 +66,7 @@ void StringList::AppendList(const char **strv, int strc) { } } -void StringList::AppendList(StringList strings) { +void StringList::AppendList(const StringList &strings) { m_strings.reserve(m_strings.size() + strings.GetSize()); m_strings.insert(m_strings.end(), strings.begin(), strings.end()); } `````````` </details> https://github.com/llvm/llvm-project/pull/173779 _______________________________________________ lldb-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits
