Skip to content

Commit fe38030

Browse files
kazutakahirataTIFitis
authored andcommitted
[lldb] Use llvm::unique (NFC) (llvm#139910)
While I am at it, this patch removes the "if" statement. std::vector::erase(first, last) doesn't do anything when first == last.
1 parent 9f939f5 commit fe38030

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

lldb/source/Target/DynamicRegisterInfo.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,10 +497,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
497497
pos != end; ++pos) {
498498
if (pos->second.size() > 1) {
499499
llvm::sort(pos->second);
500-
reg_num_collection::iterator unique_end =
501-
std::unique(pos->second.begin(), pos->second.end());
502-
if (unique_end != pos->second.end())
503-
pos->second.erase(unique_end, pos->second.end());
500+
pos->second.erase(llvm::unique(pos->second), pos->second.end());
504501
}
505502
assert(!pos->second.empty());
506503
if (pos->second.back() != LLDB_INVALID_REGNUM)

0 commit comments

Comments
 (0)