From 1339c7b146eee32134cb43ef67bcb2a5c94bc2ec Mon Sep 17 00:00:00 2001 From: Edd Robinson Date: Fri, 2 Dec 2016 12:10:39 +0000 Subject: [PATCH] Initialise HLL with error --- pkg/estimator/hll/hll.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/estimator/hll/hll.go b/pkg/estimator/hll/hll.go index 5ab1f4a53c..b94cd359c0 100644 --- a/pkg/estimator/hll/hll.go +++ b/pkg/estimator/hll/hll.go @@ -86,6 +86,15 @@ func NewPlus(p uint8) (*Plus, error) { return hll, nil } +// NewDefaultPlus creates a new Plus with the default precision. +func NewDefaultPlus() *Plus { + p, err := NewPlus(DefaultPrecision) + if err != nil { + panic(err) + } + return p +} + // MustNewPlus returns a new Plus with precision p. Panic on error. func MustNewPlus(p uint8) *Plus { hll, err := NewPlus(p)