Skip to content

Commit

Permalink
[clang-refactor] Simplify code with std::map::operator[] (NFC) (#114933)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Nov 5, 2024
1 parent 665dd23 commit e28d440
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions clang/tools/clang-refactor/TestSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,10 +373,7 @@ findTestSelectionRanges(StringRef Filename) {
EndOffset = Offset;
}
TestSelectionRange Range = {Offset, EndOffset};
auto It = GroupedRanges.insert(std::make_pair(
Matches[1].str(), SmallVector<TestSelectionRange, 8>{Range}));
if (!It.second)
It.first->second.push_back(Range);
GroupedRanges[Matches[1].str()].push_back(Range);
}
if (GroupedRanges.empty()) {
llvm::errs() << "error: -selection=test:" << Filename
Expand Down

0 comments on commit e28d440

Please sign in to comment.