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
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.
if max > min {
return true
}
return false
return max > min