Browse Source

Use preconstructed formatting options

Reduce GC pressure by avoiding repeated construction of large options
objects
pull/724/head
Ed Harvey 9 years ago
parent
commit
e3bda5b1b4
  1. 5
      ILSpy/Languages/CSharpLanguage.cs

5
ILSpy/Languages/CSharpLanguage.cs

@ -548,10 +548,13 @@ namespace ICSharpCode.ILSpy
((ComposedType)astType).PointerRank--; ((ComposedType)astType).PointerRank--;
} }
astType.AcceptVisitor(new CSharpOutputVisitor(w, FormattingOptionsFactory.CreateAllman())); astType.AcceptVisitor(new CSharpOutputVisitor(w, TypeToStringFormattingOptions));
return w.ToString(); return w.ToString();
} }
static readonly CSharpFormattingOptions TypeToStringFormattingOptions = FormattingOptionsFactory.CreateEmpty();
public override string FormatPropertyName(PropertyDefinition property, bool? isIndexer) public override string FormatPropertyName(PropertyDefinition property, bool? isIndexer)
{ {
if (property == null) if (property == null)

Loading…
Cancel
Save