Fix matrix interval time calculation.

This commit is contained in:
Julius Volz 2013-01-11 01:12:34 +01:00
parent fdf9a3aab7
commit c52b959fda
1 changed files with 1 additions and 2 deletions

View File

@ -110,11 +110,10 @@ func NewMatrix(vector ast.Node, intervalStr string) (ast.MatrixNode, error) {
default: default:
return nil, rulesError("Intervals are currently only supported for vector literals.") return nil, rulesError("Intervals are currently only supported for vector literals.")
} }
duration, err := stringToDuration(intervalStr) interval, err := stringToDuration(intervalStr)
if err != nil { if err != nil {
return nil, err return nil, err
} }
interval := time.Duration(duration) * time.Second
vectorLiteral := vector.(*ast.VectorLiteral) vectorLiteral := vector.(*ast.VectorLiteral)
return ast.NewMatrixLiteral(vectorLiteral, interval), nil return ast.NewMatrixLiteral(vectorLiteral, interval), nil
} }