We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8bccba commit 074f0bbCopy full SHA for 074f0bb
1 file changed
chartLib/src/main/kotlin/info/appdev/charting/data/BarEntry.kt
@@ -225,14 +225,7 @@ open class BarEntry : Entry {
225
* Calculates the sum across all values of the given stack.
226
*/
227
private fun calcSum(vals: FloatArray?): Float {
228
- if (vals == null)
229
- return 0f
230
-
231
- var sum = 0f
232
233
- for (f in vals) sum += f
234
235
- return sum
+ return vals?.sum() ?: 0f
236
}
237
238
0 commit comments