Skip to content

Commit 8507fbb

Browse files
committed
address review comments
1 parent 7e91a88 commit 8507fbb

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

generator/internal/mixin_utils.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,10 @@ std::unordered_set<std::string> GetMethodNames(
142142

143143
std::vector<MixinService> GetMixinServiceProto(
144144
YAML::Node const& service_config) {
145-
std::vector<MixinService> proto_paths;
146-
if (service_config.Type() != YAML::NodeType::Map) return proto_paths;
145+
std::vector<MixinService> mixin_services;
146+
if (service_config.Type() != YAML::NodeType::Map) return mixin_services;
147147
auto const& apis = service_config["apis"];
148-
if (apis.Type() != YAML::NodeType::Sequence) return proto_paths;
148+
if (apis.Type() != YAML::NodeType::Sequence) return mixin_services;
149149
for (auto const& api : apis) {
150150
if (api.Type() != YAML::NodeType::Map) continue;
151151
auto const& name = api["name"];
@@ -154,9 +154,9 @@ std::vector<MixinService> GetMixinServiceProto(
154154
auto const& mixin_proto_path_map = GetMixinProtoPathMap();
155155
auto const it = mixin_proto_path_map.find(service);
156156
if (it == mixin_proto_path_map.end()) continue;
157-
proto_paths.push_back({it->first, it->second});
157+
mixin_services.push_back({it->first, it->second});
158158
}
159-
return proto_paths;
159+
return mixin_services;
160160
}
161161

162162
std::vector<MixinService> GetMixinServiceProto(

generator/standalone_main.cc

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,22 +392,23 @@ std::vector<std::future<google::cloud::Status>> GenerateCodeFromProtos(
392392
google::cloud::generator_internal::GetMixinServiceProto(path);
393393
args.emplace_back(absl::StrCat("--cpp_codegen_opt=service_config_yaml=",
394394
std::move(path)));
395-
for (auto const& mixin_service : mixins) {
395+
for (auto& mixin_service : mixins) {
396396
if (mixin_service.proto_file_path != service.service_proto_path()) {
397397
args.emplace_back("--cpp_codegen_opt=omit_service=" +
398-
mixin_service.service_full_name);
399-
mixin_files_to_append.push_back(mixin_service.proto_file_path);
398+
std::move(mixin_service.service_full_name));
399+
mixin_files_to_append.push_back(
400+
std::move(mixin_service.proto_file_path));
400401
}
401402
}
402403
}
403404

404-
args.emplace_back(service.service_proto_path());
405+
args.push_back(service.service_proto_path());
405406
for (auto const& additional_proto_file : service.additional_proto_files()) {
406-
args.emplace_back(additional_proto_file);
407+
args.push_back(additional_proto_file);
407408
}
408409

409-
for (auto const& m : mixin_files_to_append) {
410-
args.emplace_back(m);
410+
for (auto& mixin_path : mixin_files_to_append) {
411+
args.push_back(std::move(mixin_path));
411412
}
412413

413414
GCP_LOG(INFO) << "Generating service code using: "

0 commit comments

Comments
 (0)