Browse Source

Invert the if condition to reduce nesting.

pull/552/merge
triton 10 years ago
parent
commit
0108a5a23e
  1. 8
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs

8
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -958,8 +958,9 @@ namespace CppSharp.Generators.CSharp @@ -958,8 +958,9 @@ namespace CppSharp.Generators.CSharp
private bool WrapSetterArrayOfPointers(string name, Type fieldType)
{
var arrayType = fieldType as ArrayType;
if (arrayType != null && arrayType.Type.IsPointerToPrimitiveType())
{
if (arrayType == null || !arrayType.Type.IsPointerToPrimitiveType())
return false;
NewLine();
WriteStartBraceIndent();
WriteLine("{0} = value;", name);
@ -969,10 +970,9 @@ namespace CppSharp.Generators.CSharp @@ -969,10 +970,9 @@ namespace CppSharp.Generators.CSharp
WriteCloseBraceIndent();
WriteCloseBraceIndent();
PopBlock(NewLineKind.BeforeNextBlock);
return true;
}
return false;
}
private void GenerateIndexerSetter(Function function)
{

Loading…
Cancel
Save