فهرست منبع

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
Adam Cozzette 4 سال پیش
والد
کامیت
551b440aaa

+ 1 - 0
src/google/protobuf/compiler/objectivec/objectivec_generator.cc

@@ -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 {

+ 1 - 1
src/google/protobuf/compiler/php/php_generator.cc

@@ -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") {