File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -254,19 +254,17 @@ DataFrameInternal >> initialize: aPoint [
254254{ #category : #accessing }
255255DataFrameInternal >> numberOfColumns [
256256
257- contents numberOfColumns isNil
258- ifTrue: [ ^ 0 ].
259-
260- ^ contents numberOfColumns.
257+ contents numberOfColumns ifNil: [ ^ 0 ].
258+
259+ ^ contents numberOfColumns
261260]
262261
263262{ #category : #accessing }
264263DataFrameInternal >> numberOfRows [
265264
266- contents numberOfRows isNil
267- ifTrue: [ ^ 0 ].
268-
269- ^ contents numberOfRows.
265+ contents numberOfRows ifNil: [ ^ 0 ].
266+
267+ ^ contents numberOfRows
270268]
271269
272270{ #category : #printing }
Original file line number Diff line number Diff line change @@ -193,9 +193,11 @@ DataSeries >> collect: aBlock [
193193{ #category : #enumerating }
194194DataSeries >> collectWithNotNils: aBlock [
195195 " Applies aBlock to every non-nil element"
196+
196197 ^ self collect: [ :each |
197- each isNil ifTrue: [ nil ] ifFalse: [ aBlock value: each ]
198- ]
198+ each
199+ ifNil: [ nil ]
200+ ifNotNil: [ aBlock value: each ] ]
199201]
200202
201203{ #category : #' as yet unclassified' }
@@ -520,10 +522,8 @@ DataSeries >> removeNils [
520522{ #category : #replacing }
521523DataSeries >> replaceNilsWith: anObject [
522524 " Replaces nils inplace with anObject"
523-
524- self withIndexDo: [ :ele :index |
525- ele isNil
526- ifTrue: [ self atIndex: index put: anObject ] ]
525+
526+ self withIndexDo: [ :ele :index | ele ifNil: [ self atIndex: index put: anObject ] ]
527527]
528528
529529{ #category : #replacing }
You can’t perform that action at this time.
0 commit comments