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/field_mask.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/field_mask.pb.cc')
-rw-r--r-- | src/google/protobuf/field_mask.pb.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/google/protobuf/field_mask.pb.cc b/src/google/protobuf/field_mask.pb.cc index dc639e42..c9409fe5 100644 --- a/src/google/protobuf/field_mask.pb.cc +++ b/src/google/protobuf/field_mask.pb.cc @@ -232,7 +232,7 @@ void FieldMask::SerializeWithCachedSizes( ::google::protobuf::io::CodedOutputStream* output) const { // @@protoc_insertion_point(serialize_start:google.protobuf.FieldMask) // repeated string paths = 1; - for (int i = 0; i < this->paths_size(); i++) { + for (int i = 0, n = this->paths_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->paths(i).data(), this->paths(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -249,7 +249,7 @@ void FieldMask::SerializeWithCachedSizes( (void)deterministic; // Unused // @@protoc_insertion_point(serialize_to_array_start:google.protobuf.FieldMask) // repeated string paths = 1; - for (int i = 0; i < this->paths_size(); i++) { + for (int i = 0, n = this->paths_size(); i < n; i++) { ::google::protobuf::internal::WireFormatLite::VerifyUtf8String( this->paths(i).data(), this->paths(i).length(), ::google::protobuf::internal::WireFormatLite::SERIALIZE, @@ -269,7 +269,7 @@ size_t FieldMask::ByteSizeLong() const { // repeated string paths = 1; total_size += 1 * ::google::protobuf::internal::FromIntSize(this->paths_size()); - for (int i = 0; i < this->paths_size(); i++) { + for (int i = 0, n = this->paths_size(); i < n; i++) { total_size += ::google::protobuf::internal::WireFormatLite::StringSize( this->paths(i)); } |