Skip to content

Commit 00cb966

Browse files
[lld] Use *Set::insert_range (NFC) (#132590)
DenseSet, SmallPtrSet, SmallSet, SetVector, and StringSet recently gained C++23-style insert_range. This patch replaces: Dest.insert(Src.begin(), Src.end()); with: Dest.insert_range(Src);
1 parent 441c9a9 commit 00cb966

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lld/ELF/LinkerScript.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ void LinkerScript::processSectionCommands() {
797797
if (!potentialSpillLists.empty()) {
798798
DenseSet<StringRef> insertNames;
799799
for (InsertCommand &ic : insertCommands)
800-
insertNames.insert(ic.names.begin(), ic.names.end());
800+
insertNames.insert_range(ic.names);
801801
for (SectionCommand *&base : sectionCommands) {
802802
auto *osd = dyn_cast<OutputDesc>(base);
803803
if (!osd)

lld/wasm/Writer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,15 +588,15 @@ void Writer::populateTargetFeatures() {
588588

589589
if (ctx.arg.extraFeatures.has_value()) {
590590
auto &extraFeatures = *ctx.arg.extraFeatures;
591-
allowed.insert(extraFeatures.begin(), extraFeatures.end());
591+
allowed.insert_range(extraFeatures);
592592
}
593593

594594
// Only infer used features if user did not specify features
595595
bool inferFeatures = !ctx.arg.features.has_value();
596596

597597
if (!inferFeatures) {
598598
auto &explicitFeatures = *ctx.arg.features;
599-
allowed.insert(explicitFeatures.begin(), explicitFeatures.end());
599+
allowed.insert_range(explicitFeatures);
600600
if (!ctx.arg.checkFeatures)
601601
goto done;
602602
}

0 commit comments

Comments
 (0)