Skip to content

Commit

Permalink
Internal Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 540289901
  • Loading branch information
protobuf-github-bot authored and copybara-github committed Jun 14, 2023
1 parent 2cf94fa commit e4b500c
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/google/protobuf/descriptor_database.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1022,23 +1022,18 @@ bool MergedDescriptorDatabase::FindFileContainingExtension(

bool MergedDescriptorDatabase::FindAllExtensionNumbers(
const std::string& extendee_type, std::vector<int>* output) {
// NOLINTNEXTLINE(google3-runtime-rename-unnecessary-ordering)
absl::btree_set<int> merged_results;
std::vector<int> results;
bool success = false;

for (DescriptorDatabase* source : sources_) {
if (source->FindAllExtensionNumbers(extendee_type, &results)) {
std::copy(results.begin(), results.end(),
std::insert_iterator<absl::btree_set<int> >(
merged_results, merged_results.begin()));
for (int r : results) merged_results.insert(r);
success = true;
}
results.clear();
}

std::copy(merged_results.begin(), merged_results.end(),
std::insert_iterator<std::vector<int> >(*output, output->end()));

for (int r : merged_results) output->push_back(r);
return success;
}

Expand Down

0 comments on commit e4b500c

Please sign in to comment.