https://github.com/sfu2 created https://github.com/llvm/llvm-project/pull/173779

Eliminate redundant vector copies in StringList  and its dependent classes.

>From 5e3e37d403a1ba84ea81beda6297151cbb0e5575 Mon Sep 17 00:00:00 2001
From: sfu <[email protected]>
Date: Sun, 28 Dec 2025 14:53:16 +0000
Subject: [PATCH] [lldb] Avoid unnecessary vector copy for
 StringList::AppendList

Eliminate redundant vector copies in StringList  and its dependent classes.
---
 lldb/include/lldb/Utility/StringList.h | 2 +-
 lldb/source/Utility/StringList.cpp     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

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());
 }

_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to