Skip to content

Commit fdfe56b

Browse files
perf: cache common StringDoc types
1 parent 3ed600b commit fdfe56b

File tree

3 files changed

+479
-5
lines changed

3 files changed

+479
-5
lines changed

Src/CSharpier/DocTypes/Doc.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ public override string ToString()
1212
return DocSerializer.Serialize(this);
1313
}
1414

15-
public static implicit operator Doc(string value)
16-
{
17-
return new StringDoc(value);
18-
}
15+
public static implicit operator Doc(string value) => StringDoc.Create(value);
1916

2017
public static NullDoc Null => NullDoc.Instance;
2118

0 commit comments

Comments
 (0)