Merge pull request #488 from AntonyCorbett/perf_linq_01

Small perf improvement in LINQ
This commit is contained in:
Marcin Ziąbek
2023-03-06 10:54:10 +01:00
committed by GitHub
+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; }