Small perf improvement in LINQ

This commit is contained in:
Antony Corbett
2023-02-12 13:59:31 +00:00
parent 30bd7420e2
commit 8679391609
+1 -1
View File
@@ -15,7 +15,7 @@ namespace QuestPDF.Elements.Text
public HorizontalAlignment? Alignment { get; set; }
public List<ITextBlockItem> Items { get; set; } = new List<ITextBlockItem>();
public string Text => string.Join(" ", Items.Where(x => x is TextBlockSpan).Cast<TextBlockSpan>().Select(x => x.Text));
public string Text => string.Join(" ", Items.OfType<TextBlockSpan>().Select(x => x.Text));
private Queue<ITextBlockItem> RenderingQueue { get; set; }
private int CurrentElementIndex { get; set; }