diff options
author | Chris Kennelly <ckennelly@google.com> | 2017-01-31 12:27:32 -0800 |
---|---|---|
committer | Chris Kennelly <ckennelly@google.com> | 2017-02-15 11:41:46 -0800 |
commit | 8af35f28f696b5fa70ec7cfb64111f87b45d55b7 (patch) | |
tree | 5033fde1e05faf51ef753d304a91f753c8530e69 /src/google/protobuf/type.pb.cc | |
parent | a6c30d97054bbd6d591e471da112c5dfef501bb4 (diff) | |
download | protobuf-8af35f28f696b5fa70ec7cfb64111f87b45d55b7.tar.gz protobuf-8af35f28f696b5fa70ec7cfb64111f87b45d55b7.tar.bz2 protobuf-8af35f28f696b5fa70ec7cfb64111f87b45d55b7.zip |
Keep loop bounds in a local variable for string fields.
Diffstat (limited to 'src/google/protobuf/type.pb.cc')
-rw-r--r-- | src/google/protobuf/type.pb.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/google/protobuf/type.pb.cc b/src/google/protobuf/type.pb.cc index 1eb23ff5..8bf57ecf 100644 --- a/src/google/protobuf/type.pb.cc +++ b/src/google/protobuf/type.pb.cc @@ -613,7 +613,7 @@ void Type::SerializeWithCachedSizes( } // repeated string oneofs = 3; - for (int i = 0; i < this->oneofs_size(); i++) { + for (int i = 0, n = this->oneofs_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(i).data(), this->oneofs(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -666,7 +666,7 @@ void Type::SerializeWithCachedSizes( } // repeated string oneofs = 3; - for (int i = 0; i < this->oneofs_size(); i++) { + for (int i = 0, n = this->oneofs_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->oneofs(i).data(), this->oneofs(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -717,7 +717,7 @@ size_t Type::ByteSizeLong() const { // repeated string oneofs = 3; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->oneofs_size()); - for (int i = 0; i < this->oneofs_size(); i++) { + for (int i = 0, n = this->oneofs_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->oneofs(i)); } |