diff options
Diffstat (limited to 'src/google/protobuf/compiler/csharp/csharp_field_base.cc')
-rw-r--r-- | src/google/protobuf/compiler/csharp/csharp_field_base.cc | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/google/protobuf/compiler/csharp/csharp_field_base.cc b/src/google/protobuf/compiler/csharp/csharp_field_base.cc index 7dde6f44..139cc753 100644 --- a/src/google/protobuf/compiler/csharp/csharp_field_base.cc +++ b/src/google/protobuf/compiler/csharp/csharp_field_base.cc @@ -122,19 +122,11 @@ void FieldGeneratorBase::GenerateCodecCode(io::Printer* printer) { } void FieldGeneratorBase::AddDeprecatedFlag(io::Printer* printer) { - if (descriptor_->options().deprecated()) - { + if (descriptor_->options().deprecated()) { + printer->Print("[global::System.ObsoleteAttribute]\n"); + } else if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE && + descriptor_->message_type()->options().deprecated()) { printer->Print("[global::System.ObsoleteAttribute]\n"); - } - else - { - if (descriptor_->type() == FieldDescriptor::TYPE_MESSAGE) - { - if (descriptor_->message_type()->options().deprecated()) - { - printer->Print("[global::System.ObsoleteAttribute]\n"); - } - } } } |