Fixed some minor issues

This commit fixes some minor issues that came up when I tried to
integrate changes from Git into Google's internal codebase:
- Include stubs/strutil.h for access to Split() helper function
- Use emplace() instead of insert() so that the code still works if
  we're working with a string_view instead of a string
This commit is contained in:
Adam Cozzette 2020-11-24 14:57:28 -08:00
parent 977dde9ee3
commit 551b440aaa
2 changed files with 2 additions and 1 deletions

View File

@ -35,6 +35,7 @@
#include <google/protobuf/compiler/objectivec/objectivec_helpers.h> #include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
#include <google/protobuf/io/printer.h> #include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h> #include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>
namespace google { namespace google {
namespace protobuf { namespace protobuf {

View File

@ -2255,7 +2255,7 @@ bool Generator::GenerateAll(const std::vector<const FileDescriptor*>& files,
if (HasPrefixString(option_pair[0], "aggregate_metadata")) { if (HasPrefixString(option_pair[0], "aggregate_metadata")) {
options.aggregate_metadata = true; options.aggregate_metadata = true;
for (const auto& prefix : Split(option_pair[1], "#", false)) { for (const auto& prefix : Split(option_pair[1], "#", false)) {
options.aggregate_metadata_prefixes.insert(prefix); options.aggregate_metadata_prefixes.emplace(prefix);
GOOGLE_LOG(INFO) << prefix; GOOGLE_LOG(INFO) << prefix;
} }
} else if (option_pair[0] == "internal") { } else if (option_pair[0] == "internal") {