Skip to content

Commit b33cc64

Browse files
[lldb] Use *Set::insert_range and a range constructor (NFC) (#133548)
This patch uses *Set::insert_range and a range constructor of DenseSet to clean up the code to populate sets.
1 parent edef028 commit b33cc64

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

lldb/source/Host/common/NativeProcessProtocol.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ lldb_private::Status NativeProcessProtocol::Interrupt() {
4343

4444
Status NativeProcessProtocol::IgnoreSignals(llvm::ArrayRef<int> signals) {
4545
m_signals_to_ignore.clear();
46-
m_signals_to_ignore.insert(signals.begin(), signals.end());
46+
m_signals_to_ignore.insert_range(signals);
4747
return Status();
4848
}
4949

lldb/source/Plugins/ExpressionParser/Clang/CxxModuleHandler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ CxxModuleHandler::CxxModuleHandler(ASTImporter &importer, ASTContext *target)
4242
"allocator",
4343
"pair",
4444
};
45-
m_supported_templates.insert(supported_names.begin(), supported_names.end());
45+
m_supported_templates.insert_range(supported_names);
4646
}
4747

4848
/// Builds a list of scopes that point into the given context.

lldb/tools/lldb-dap/Handler/SetInstructionBreakpointsRequestHandler.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,8 @@ void SetInstructionBreakpointsRequestHandler::operator()(
213213
// Disable any instruction breakpoints that aren't in this request.
214214
// There is no call to remove instruction breakpoints other than calling this
215215
// function with a smaller or empty "breakpoints" list.
216-
llvm::DenseSet<lldb::addr_t> seen;
217-
for (const auto &addr : dap.instruction_breakpoints)
218-
seen.insert(addr.first);
216+
llvm::DenseSet<lldb::addr_t> seen(
217+
llvm::from_range, llvm::make_first_range(dap.instruction_breakpoints));
219218

220219
for (const auto &bp : *breakpoints) {
221220
const auto *bp_obj = bp.getAsObject();

0 commit comments

Comments
 (0)