Author: Kazu Hirata
Date: 2025-05-15T07:15:59-07:00
New Revision: 1f570b1c2df6ec93a90ec8f0751fe8355644f1c6

URL: 
https://github.com/llvm/llvm-project/commit/1f570b1c2df6ec93a90ec8f0751fe8355644f1c6
DIFF: 
https://github.com/llvm/llvm-project/commit/1f570b1c2df6ec93a90ec8f0751fe8355644f1c6.diff

LOG: [lldb] Use llvm::unique (NFC) (#139910)

While I am at it, this patch removes the "if" statement.
std::vector::erase(first, last) doesn't do anything when
first == last.

Added: 
    

Modified: 
    lldb/source/Target/DynamicRegisterInfo.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Target/DynamicRegisterInfo.cpp 
b/lldb/source/Target/DynamicRegisterInfo.cpp
index 9ad98a41c688c..b964dc5877a97 100644
--- a/lldb/source/Target/DynamicRegisterInfo.cpp
+++ b/lldb/source/Target/DynamicRegisterInfo.cpp
@@ -497,10 +497,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
        pos != end; ++pos) {
     if (pos->second.size() > 1) {
       llvm::sort(pos->second);
-      reg_num_collection::iterator unique_end =
-          std::unique(pos->second.begin(), pos->second.end());
-      if (unique_end != pos->second.end())
-        pos->second.erase(unique_end, pos->second.end());
+      pos->second.erase(llvm::unique(pos->second), pos->second.end());
     }
     assert(!pos->second.empty());
     if (pos->second.back() != LLDB_INVALID_REGNUM)


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to