Skip to content

Commit

Permalink
ReduceStddev values is slice of slices
Browse files Browse the repository at this point in the history
  • Loading branch information
neonstalwart committed Apr 21, 2015
1 parent 3b8b526 commit 118095c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions influxql/functions.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,14 +388,14 @@ func MapStddev(itr Iterator) interface{} {
}

// ReduceStddev computes the stddev of values.
func ReduceStddev(values []interface{}) interface{} {
func ReduceStddev(values [][]float64) interface{} {
var data []float64
// Collect all the data points
for _, value := range values {
if value == nil {
continue
}
data = append(data, value.([]float64)...)
data = append(data, value...)
}

// If no data or we only have one point, it's nil or undefined
Expand Down

0 comments on commit 118095c

Please sign in to comment.