diff options
author | Vincent Vanhoucke <vanhoucke@google.com> | 2016-08-31 16:01:52 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-08-31 17:17:24 -0700 |
commit | 7a1210bdbdade7210d48db287065ecac950338aa (patch) | |
tree | c39be641a1072944866b16d3daed4204c9bb5543 /tensorflow/tools/proto_text | |
parent | 62c159ffe847eeb788550a32b8be572e41055022 (diff) |
Fix ~63 ClangTidy - Performance findings in TensorFlow.
Change: 131891101
Diffstat (limited to 'tensorflow/tools/proto_text')
-rw-r--r-- | tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc b/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc index 77484a4d52..a5b0f03a25 100644 --- a/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc +++ b/tensorflow/tools/proto_text/gen_proto_text_functions_lib.cc @@ -294,7 +294,7 @@ void Generator::AppendFieldValueAppend(const FieldDescriptor& field, } void Generator::AppendFieldAppend(const FieldDescriptor& field) { - const string name = field.name(); + const string& name = field.name(); if (field.is_map()) { Print("{").Nest(); @@ -445,7 +445,7 @@ void Generator::AppendParseMessageFunction(const Descriptor& md) { Unnest().Print("}"); for (int i = 0; i < md.field_count(); ++i) { const FieldDescriptor* field = md.field(i); - const string field_name = field->name(); + const string& field_name = field->name(); string mutable_value_expr; string set_value_prefix; if (map_append) { @@ -530,7 +530,7 @@ void Generator::AppendParseMessageFunction(const Descriptor& md) { for (int enum_i = 0; enum_i < enum_d->value_count(); ++enum_i) { const auto* value_d = enum_d->value(enum_i); - const string value_name = value_d->name(); + const string& value_name = value_d->name(); string condition = StrCat("value == \"", value_name, "\" || value == \"", value_d->number(), "\""); if (value_d->number() == 0) { |