diff options
author | 2017-01-31 12:27:32 -0800 | |
---|---|---|
committer | 2017-02-15 11:41:46 -0800 | |
commit | 8af35f28f696b5fa70ec7cfb64111f87b45d55b7 (patch) | |
tree | 5033fde1e05faf51ef753d304a91f753c8530e69 /src/google/protobuf/compiler/plugin.pb.cc | |
parent | a6c30d97054bbd6d591e471da112c5dfef501bb4 (diff) |
Keep loop bounds in a local variable for string fields.
Diffstat (limited to 'src/google/protobuf/compiler/plugin.pb.cc')
-rw-r--r-- | src/google/protobuf/compiler/plugin.pb.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/google/protobuf/compiler/plugin.pb.cc b/src/google/protobuf/compiler/plugin.pb.cc index f806392a..686ee477 100644 --- a/src/google/protobuf/compiler/plugin.pb.cc +++ b/src/google/protobuf/compiler/plugin.pb.cc @@ -887,7 +887,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.compiler.CodeGeneratorRequest) // repeated string file_to_generate = 1; - for (int i = 0; i < this->file_to_generate_size(); i++) { + for (int i = 0, n = this->file_to_generate_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->file_to_generate(i).data(), this->file_to_generate(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -930,7 +930,7 @@ void CodeGeneratorRequest::SerializeWithCachedSizes( (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.compiler.CodeGeneratorRequest) // repeated string file_to_generate = 1; - for (int i = 0; i < this->file_to_generate_size(); i++) { + for (int i = 0, n = this->file_to_generate_size(); i < n; i++) { ::google::protobuf::internal::WireFormat::VerifyUTF8StringNamedField( this->file_to_generate(i).data(), this->file_to_generate(i).length(), ::google::protobuf::internal::WireFormat::SERIALIZE, @@ -984,7 +984,7 @@ size_t CodeGeneratorRequest::ByteSizeLong() const { // repeated string file_to_generate = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->file_to_generate_size()); - for (int i = 0; i < this->file_to_generate_size(); i++) { + for (int i = 0, n = this->file_to_generate_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->file_to_generate(i)); } |