Skip to content

Commit

Permalink
Fixed some minor issues
Browse files Browse the repository at this point in the history
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
  • Loading branch information
acozzette committed Nov 24, 2020
1 parent 977dde9 commit 551b440
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <google/protobuf/compiler/objectivec/objectivec_helpers.h>
#include <google/protobuf/io/printer.h>
#include <google/protobuf/io/zero_copy_stream.h>
#include <google/protobuf/stubs/strutil.h>

namespace google {
namespace protobuf {
Expand Down
2 changes: 1 addition & 1 deletion src/google/protobuf/compiler/php/php_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2255,7 +2255,7 @@ bool Generator::GenerateAll(const std::vector<const FileDescriptor*>& files,
if (HasPrefixString(option_pair[0], "aggregate_metadata")) {
options.aggregate_metadata = true;
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;
}
} else if (option_pair[0] == "internal") {
Expand Down

0 comments on commit 551b440

Please sign in to comment.