Skip to content

Commit

Permalink
Last refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sven1103 committed Aug 27, 2024
1 parent 0c9f90f commit 7bedae6
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,12 @@ public ParsingResult parse(InputStream inputStream) {
}

var values = content.subList(1, content.size());
var iterator = values.iterator();
List<ParsingResult.Row> rows = new ArrayList<>();
while (iterator.hasNext()) {
var row = iterator.next().split(VALUE_SEPARATOR);
for (String row : values) {
var rowContent = row.split(VALUE_SEPARATOR);
String[] rowData = new String[header.length];
for (Entry<String, Integer> propertyEntry : propertyToIndex.entrySet()) {
rowData[propertyEntry.getValue()] = safeAccess(row, propertyEntry.getValue()).orElse("");
rowData[propertyEntry.getValue()] = safeAccess(rowContent, propertyEntry.getValue()).orElse("");
}
rows.add(new Row(Arrays.stream(rowData).toList()));
}
Expand Down

0 comments on commit 7bedae6

Please sign in to comment.