提交 2f70a036 编写于 作者: C Cyrus Najmabadi

simplify

上级 fad4fd69
...@@ -77,7 +77,7 @@ private static BlockStructure CreateBlockStructure(BlockStructureContext context ...@@ -77,7 +77,7 @@ private static BlockStructure CreateBlockStructure(BlockStructureContext context
var showOutliningForDeclarationLevelConstructs = options.GetOption(BlockStructureOptions.ShowOutliningForDeclarationLevelConstructs, language); var showOutliningForDeclarationLevelConstructs = options.GetOption(BlockStructureOptions.ShowOutliningForDeclarationLevelConstructs, language);
var showOutliningForCommentsAndPreprocessorRegions = options.GetOption(BlockStructureOptions.ShowOutliningForCommentsAndPreprocessorRegions, language); var showOutliningForCommentsAndPreprocessorRegions = options.GetOption(BlockStructureOptions.ShowOutliningForCommentsAndPreprocessorRegions, language);
var updatedSpans = ArrayBuilder<BlockSpan>.GetInstance(); using var _ = ArrayBuilder<BlockSpan>.GetInstance(out var updatedSpans);
foreach (var span in context.Spans) foreach (var span in context.Spans)
{ {
var updatedSpan = UpdateBlockSpan(span, var updatedSpan = UpdateBlockSpan(span,
...@@ -90,7 +90,7 @@ private static BlockStructure CreateBlockStructure(BlockStructureContext context ...@@ -90,7 +90,7 @@ private static BlockStructure CreateBlockStructure(BlockStructureContext context
updatedSpans.Add(updatedSpan); updatedSpans.Add(updatedSpan);
} }
return new BlockStructure(updatedSpans.ToImmutableAndFree()); return new BlockStructure(updatedSpans.ToImmutable());
} }
private static BlockSpan UpdateBlockSpan(BlockSpan blockSpan, private static BlockSpan UpdateBlockSpan(BlockSpan blockSpan,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册