mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Syntax] Represent missing optioanl nodes as nullptr (#14300)
Allocating RawSyntax/SyntaxData for missing optional node is a waste of resource.
This commit is contained in:
@@ -1799,7 +1799,7 @@ void SwiftEditorDocument::readSyntaxInfo(EditorConsumer &Consumer) {
|
||||
llvm::raw_string_ostream OS(SyntaxContent);
|
||||
json::Output JsonOut(OS);
|
||||
auto Root = Impl.SyntaxInfo->getSourceFile().getSyntaxRoot().getRaw();
|
||||
JsonOut << Root;
|
||||
JsonOut << *Root;
|
||||
Consumer.handleSerializedSyntaxTree(OS.str());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user