Skip to content

Commit d1b3406

Browse files
Avoided code duplication by calling #addRow:atPosition:
1 parent 8f88306 commit d1b3406

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

src/DataFrame/DataFrame.class.st

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -398,15 +398,7 @@ DataFrame >> addEmptyRowNamed: aString atPosition: aNumber [
398398
DataFrame >> addRow: aDataSeries [
399399
"Add DataSeries as a new row at the end"
400400

401-
| row |
402-
row := Array new: self columnNames size.
403-
self columnNames withIndexDo: [ :columnName :index |
404-
| value |
405-
value := aDataSeries
406-
at: columnName
407-
ifAbsent: [ aDataSeries atIndex: index ].
408-
row at: index put: value ].
409-
self addRow: row named: aDataSeries name
401+
self addRow: aDataSeries atPosition: self numberOfRows + 1
410402
]
411403

412404
{ #category : #adding }

0 commit comments

Comments
 (0)