We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 98dd08b commit f7faadeCopy full SHA for f7faade
src/DataFrame/DataSeries.class.st
@@ -664,7 +664,10 @@ DataSeries >> sortedDescending [
664
DataSeries >> sum [
665
"Return the sum of the values over the requested axis. Nil values are excluded."
666
667
- ^ (self reject: #isNil) inject: 0 into: [ :accum :each | accum + each ]
+ | result |
668
+ result := 0.
669
+ self do: [ :each | each ifNotNil: [ result := result + each ] ].
670
+ ^ result
671
]
672
673
{ #category : #statistics }
0 commit comments