Merge pull request #476 from AntonyCorbett/small_dictionary_perf

prevent double lookup
This commit is contained in:
Marcin Ziąbek
2023-03-06 10:49:00 +01:00
committed by GitHub
+1 -1
View File
@@ -80,7 +80,7 @@ namespace QuestPDF.Elements.Table
CellsCache = Enumerable
.Range(0, MaxRow + 1)
.Select(x => groups.ContainsKey(x) ? groups[x] : Array.Empty<TableCell>())
.Select(x => groups.TryGetValue(x, out var value) ? value : Array.Empty<TableCell>())
.ToArray();
}