Browse Source

prevent double lookup

Antony Corbett 2 years ago
parent
commit
5fd72cbb4b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/QuestPDF/Elements/Table/Table.cs

+ 1 - 1
Source/QuestPDF/Elements/Table/Table.cs

@@ -80,7 +80,7 @@ namespace QuestPDF.Elements.Table
 
 
             CellsCache = Enumerable
             CellsCache = Enumerable
                 .Range(0, MaxRow + 1)
                 .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();
                 .ToArray();
         }
         }