should use 'return len(w.Data) != w.nans' instead of 'if len(w.Data) == w.nans { return false }; return true'
179// IsNonNull checks if the window's data contains only NaN values
180// This is to prevent returning -Inf when the window's data contains only NaN values
181func (w *Windowed) IsNonNull() bool {
182 if len(w.Data) == w.nans {183 return false
184 }
185 return true
Description
Instead of conditionally checking for the value of a boolean expression and then
returning true
or false
, returning the expression itself simplifies the code
and improves readability.
Bad practice
if max > min {
return true
}
return false
Recommended
return max > min