[Lldb-commits] [lldb] 1f570b1 - [lldb] Use llvm::unique (NFC) (#139910)
via lldb-commits
lldb-commits at lists.llvm.org
Thu May 15 07:16:04 PDT 2025
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)
More information about the lldb-commits
mailing list