Commit 837fd444 authored by Joey's avatar Joey

Glucose: use proper method to check if Float equals NaN

Signed-off-by: Joey's avatarJoey <bevilacquajoey@gmail.com>
parent 3399fa58
......@@ -19,6 +19,7 @@ import it.diab.ui.MainFragment
import it.diab.ui.graph.OverviewGraphView
import it.diab.util.extensions.getAsMinutes
import it.diab.util.extensions.isToday
import it.diab.util.extensions.isZeroOrNan
class OverviewFragment : MainFragment() {
private lateinit var mBanner: BannerView
......@@ -109,7 +110,7 @@ class OverviewFragment : MainFragment() {
private fun getAverageDataSet(data: HashMap<Int, Float>): LineDataSet? {
val entries = data
.filterNot { it.value == 0f || Float.NaN.equals(it.value) }
.filterNot { it.value.isZeroOrNan() }
.map { Entry(it.key * 60f, it.value) }
.sortedBy { it.x }
......
package it.diab.util.extensions
fun Float.isZeroOrNan() = 0f == this || isNaN()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment