Remove redundant conversion. Use val where possible.
All checks were successful
Build Android / build (push) Successful in 7m19s
All checks were successful
Build Android / build (push) Successful in 7m19s
This commit is contained in:
@@ -38,8 +38,8 @@ fun RoundGraphView(rounds: List<Round>, modifier: Modifier = Modifier) {
|
|||||||
chart = lineChart(
|
chart = lineChart(
|
||||||
lines = listOf(specA, specB),
|
lines = listOf(specA, specB),
|
||||||
axisValuesOverrider = AxisValuesOverrider.fixed(
|
axisValuesOverrider = AxisValuesOverrider.fixed(
|
||||||
minY = range.first.toFloat(),
|
minY = range.first,
|
||||||
maxY = range.second.toFloat()
|
maxY = range.second
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
model = composedChartEntryModelOf(
|
model = composedChartEntryModelOf(
|
||||||
@@ -58,8 +58,8 @@ fun RoundGraphView(rounds: List<Round>, modifier: Modifier = Modifier) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getPoints(rounds: List<Round>): Pair<List<FloatEntry>, List<FloatEntry>> {
|
private fun getPoints(rounds: List<Round>): Pair<List<FloatEntry>, List<FloatEntry>> {
|
||||||
var a = mutableListOf(FloatEntry(0f, 0f))
|
val a = mutableListOf(FloatEntry(0f, 0f))
|
||||||
var b = mutableListOf(FloatEntry(0f, 0f))
|
val b = mutableListOf(FloatEntry(0f, 0f))
|
||||||
|
|
||||||
var sumA = 0
|
var sumA = 0
|
||||||
var sumB = 0
|
var sumB = 0
|
||||||
@@ -75,13 +75,13 @@ private fun getPoints(rounds: List<Round>): Pair<List<FloatEntry>, List<FloatEnt
|
|||||||
|
|
||||||
private fun getRange(a: List<FloatEntry>, b: List<FloatEntry>, step: Int): Pair<Float, Float> {
|
private fun getRange(a: List<FloatEntry>, b: List<FloatEntry>, step: Int): Pair<Float, Float> {
|
||||||
|
|
||||||
var min = (a + b).minBy { it -> it.y }
|
val min = (a + b).minBy { it.y }
|
||||||
var max = (a + b).maxBy { it -> it.y }
|
val max = (a + b).maxBy { it.y }
|
||||||
|
|
||||||
var lo = floor(min.y / step) * step
|
val lo = floor(min.y / step) * step
|
||||||
var hi = ceil(max.y / step) * step
|
val hi = ceil(max.y / step) * step
|
||||||
|
|
||||||
return Pair(lo.toFloat(), hi.toFloat())
|
return Pair(lo, hi)
|
||||||
}
|
}
|
||||||
|
|
||||||
@Preview(name = "Light Mode")
|
@Preview(name = "Light Mode")
|
||||||
|
|||||||
Reference in New Issue
Block a user