Skip to content

Commit

Permalink
refactor: data/histogram: update func names to `Histogram.BinValue(…
Browse files Browse the repository at this point in the history
…)`, `Histogram.BinValueOrDefault()`
  • Loading branch information
grokify committed Sep 2, 2024
1 parent dffbea7 commit 7292570
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/histogram/histogram.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ func (hist *Histogram) Inflate() {
}
}

func (hist *Histogram) BinCount(binName string) (int, error) {
func (hist *Histogram) BinValue(binName string) (int, error) {
if v, ok := hist.Bins[binName]; ok {
return v, nil
}
return -1, errors.New("bin not found")
}

func (hist *Histogram) BinCountOrDefault(binName string, def int) int {
c, err := hist.BinCount(binName)
func (hist *Histogram) BinValueOrDefault(binName string, def int) int {
c, err := hist.BinValue(binName)
if err != nil {
return def
}
Expand Down

0 comments on commit 7292570

Please sign in to comment.