Cache property lookups for the object parsing

This commit is contained in:
2016-04-27 11:16:54 -04:00
parent 9730600164
commit 790930dd66
10 changed files with 185 additions and 58 deletions
+2 -1
View File
@@ -30,6 +30,7 @@ namespace LeafWeb.Core.Parsers
private IEnumerable<LeafGasComparison> ParseLeafGasComparisonSet(string[] fittingTitles)
{
var matcher = new ParseInfoPropertyMatcher<LeafGasComparisonPhotosyntheticInfo>();
var endOfFile = false;
while (!endOfFile)
{
@@ -43,7 +44,7 @@ namespace LeafWeb.Core.Parsers
throw new ParseException($"Encountered empty line while readding fitting info on line {CsvReader.Row}");
if (values == null) // end of file
yield break;
if (ParsedObjectFactory<LeafGasComparisonPhotosyntheticInfo>.IsPropertiesTitlesMatch(values))
if (matcher.IsPropertiesTitlesMatch(values))
{
photosyntheticTitles = values;
break;