mirror of https://github.com/mum4k/termdash.git
Remove not required constants from linechart minMax wrapper
Signed-off-by: Xabier Larrakoetxea <slok69@gmail.com>
This commit is contained in:
parent
2ae5ca1dcb
commit
53abc10da3
|
@ -532,21 +532,16 @@ func (lc *LineChart) maxXValue() int {
|
||||||
return maxLen - 1
|
return maxLen - 1
|
||||||
}
|
}
|
||||||
|
|
||||||
const (
|
|
||||||
defMin = 0
|
|
||||||
defMax = 0
|
|
||||||
)
|
|
||||||
|
|
||||||
// minMax is a wrapper around numbers.MinMax that controls
|
// minMax is a wrapper around numbers.MinMax that controls
|
||||||
// the output if the values are NaN and sets defaults if it's
|
// the output if the values are NaN and sets defaults if it's
|
||||||
// the case.
|
// the case.
|
||||||
func minMax(values []float64) (x, y float64) {
|
func minMax(values []float64) (x, y float64) {
|
||||||
min, max := numbers.MinMax(values)
|
min, max := numbers.MinMax(values)
|
||||||
if math.IsNaN(min) {
|
if math.IsNaN(min) {
|
||||||
min = defMin
|
min = 0
|
||||||
}
|
}
|
||||||
if math.IsNaN(max) {
|
if math.IsNaN(max) {
|
||||||
max = defMax
|
max = 0
|
||||||
}
|
}
|
||||||
return min, max
|
return min, max
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue