aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/csharp
diff options
context:
space:
mode:
authorAndrew Spiering <aspiering@gmail.com>2017-01-11 11:18:53 -0800
committerAndrew Spiering <aspiering@gmail.com>2017-01-11 11:18:53 -0800
commit75ac3973eff1eecd0506f87bf94a51d57b3cc072 (patch)
treeebf497229eb5ff082e777eeaea73cb716c890d10 /src/google/protobuf/compiler/csharp
parenteffcb132e1c537ad0b21338603358d42d7e31803 (diff)
downloadprotobuf-75ac3973eff1eecd0506f87bf94a51d57b3cc072.tar.gz
protobuf-75ac3973eff1eecd0506f87bf94a51d57b3cc072.tar.bz2
protobuf-75ac3973eff1eecd0506f87bf94a51d57b3cc072.zip
Fixing code formatting issues
Diffstat (limited to 'src/google/protobuf/compiler/csharp')
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_field_base.cc16
-rw-r--r--src/google/protobuf/compiler/csharp/csharp_message.cc3
2 files changed, 5 insertions, 14 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");
- }
- }
}
}
diff --git a/src/google/protobuf/compiler/csharp/csharp_message.cc b/src/google/protobuf/compiler/csharp/csharp_message.cc
index 78e076c8..b0cc6694 100644
--- a/src/google/protobuf/compiler/csharp/csharp_message.cc
+++ b/src/google/protobuf/compiler/csharp/csharp_message.cc
@@ -99,8 +99,7 @@ const std::vector<const FieldDescriptor*>& MessageGenerator::fields_by_number()
}
void MessageGenerator::AddDeprecatedFlag(io::Printer* printer) {
- if (descriptor_->options().deprecated())
- {
+ if (descriptor_->options().deprecated()) {
printer->Print("[global::System.ObsoleteAttribute]\n");
}
}