From 9aeaf26f89ff3672c96570026d8274b333ad8a7b Mon Sep 17 00:00:00 2001 From: Joao Matos Date: Thu, 16 Feb 2017 00:21:41 +0000 Subject: [PATCH] Reduce nesting in CSharpSources.GenerateComment. --- .../Generators/CSharp/CSharpSources.cs | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index 84a79735..9ec4e65f 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -362,20 +362,19 @@ namespace CppSharp.Generators.CSharp PushBlock(BlockKind.BlockComment); WriteLine(comment.FullComment.CommentToString(Options.CommentPrefix)); PopBlock(); + return; } - else - { - if (string.IsNullOrWhiteSpace(comment.BriefText)) - return; - PushBlock(BlockKind.BlockComment); - WriteLine("{0} ", Options.CommentPrefix); - foreach (string line in HtmlEncoder.HtmlEncode(comment.BriefText).Split( - Environment.NewLine.ToCharArray())) - WriteLine("{0} {1}", Options.CommentPrefix, line); - WriteLine("{0} ", Options.CommentPrefix); - PopBlock(); - } + if (string.IsNullOrWhiteSpace(comment.BriefText)) + return; + + PushBlock(BlockKind.BlockComment); + WriteLine("{0} ", Options.CommentPrefix); + foreach (string line in HtmlEncoder.HtmlEncode(comment.BriefText).Split( + Environment.NewLine.ToCharArray())) + WriteLine("{0} {1}", Options.CommentPrefix, line); + WriteLine("{0} ", Options.CommentPrefix); + PopBlock(); } public void GenerateInlineSummary(RawComment comment)