From e8535e70da872c71cc69f0f04ce33d224ecba79f Mon Sep 17 00:00:00 2001 From: Adam Cozzette Date: Tue, 6 Feb 2024 09:30:23 -0800 Subject: [PATCH] Internal change PiperOrigin-RevId: 604672870 --- .../protobuf/compiler/cpp/tools/analyze_profile_proto.cc | 2 +- src/google/protobuf/descriptor.cc | 8 +++----- src/google/protobuf/editions/generated_files_test.cc | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc b/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc index ce6211c6ea..c5b300b7c3 100644 --- a/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc +++ b/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc @@ -24,6 +24,7 @@ #include "google/protobuf/compiler/access_info_map.h" #include "google/protobuf/compiler/split_map.h" #include "google/protobuf/compiler/profile_bootstrap.pb.h" +#include "google/protobuf/descriptor.pb.h" #include "absl/log/absl_log.h" #include "absl/log/log.h" #include "absl/status/status.h" @@ -37,7 +38,6 @@ #include "google/protobuf/compiler/cpp/helpers.h" #include "google/protobuf/compiler/cpp/options.h" #include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" #include "third_party/re2/re2.h" namespace google { diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 87bccd031e..4889fad3f2 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -3975,7 +3975,7 @@ class DescriptorBuilder { ~DescriptorBuilder(); - const FileDescriptor* BuildFile(const FileDescriptorProto& original_proto); + const FileDescriptor* BuildFile(const FileDescriptorProto& proto); private: DescriptorBuilder(const DescriptorPool* pool, DescriptorPool::Tables* tables, @@ -5574,10 +5574,8 @@ static void PlanAllocationSize(const FileDescriptorProto& proto, } const FileDescriptor* DescriptorBuilder::BuildFile( - const FileDescriptorProto& original_proto) { - filename_ = original_proto.name(); - - const FileDescriptorProto& proto = original_proto; + const FileDescriptorProto& proto) { + filename_ = proto.name(); // Check if the file already exists and is identical to the one being built. // Note: This only works if the input is canonical -- that is, it diff --git a/src/google/protobuf/editions/generated_files_test.cc b/src/google/protobuf/editions/generated_files_test.cc index 537be3b713..68e8fac5df 100644 --- a/src/google/protobuf/editions/generated_files_test.cc +++ b/src/google/protobuf/editions/generated_files_test.cc @@ -5,10 +5,10 @@ // license that can be found in the LICENSE file or at // https://developers.google.com/open-source/licenses/bsd +#include "google/protobuf/descriptor.pb.h" #include #include #include "google/protobuf/descriptor.h" -#include "google/protobuf/descriptor.pb.h" #include "google/protobuf/editions/golden/test_messages_proto2_editions.pb.h" #include "google/protobuf/editions/golden/test_messages_proto3_editions.pb.h" #include "google/protobuf/editions/proto/test_editions_default_features.pb.h"