Skip to content

Commit

Permalink
5X faster column-names array generation
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-jitbit committed Aug 9, 2023
1 parent 2b4b835 commit 336e9cf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion MapDataReader/MapperGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ private static void SetPropertyByUpperName(this {typeNodeSymbol.FullName()} targ
if (dr.Read())
{{
string[] columnNames = Enumerable.Range(0, dr.FieldCount).Select(i => dr.GetName(i).ToUpperInvariant()).ToArray();
string[] columnNames = new string[dr.FieldCount];
for (int i = 0; i < columnNames.Length; i++)
columnNames[i] = dr.GetName(i).ToUpperInvariant();
do
{{
var result = new {typeNodeSymbol.FullName()}();
Expand Down

0 comments on commit 336e9cf

Please sign in to comment.