diff --git a/bar.go b/bar.go index 0428f71d..7a91814a 100644 --- a/bar.go +++ b/bar.go @@ -562,10 +562,9 @@ func (s *bState) wSyncTable() (table syncTable) { return table } -func (s *bState) sortDecorators(decorators []decor.Decorator) { +func (s *bState) populateEwmaDecorators(decorators []decor.Decorator) { for _, d := range decorators { - d := unwrap(d) - if d, ok := d.(decor.EwmaDecorator); ok { + if d, ok := unwrap(d).(decor.EwmaDecorator); ok { s.ewmaDecorators = append(s.ewmaDecorators, d) } } diff --git a/bar_option.go b/bar_option.go index b39628f2..6247a334 100644 --- a/bar_option.go +++ b/bar_option.go @@ -24,7 +24,7 @@ func inspect(decorators []decor.Decorator) (dest []decor.Decorator) { func PrependDecorators(decorators ...decor.Decorator) BarOption { decorators = inspect(decorators) return func(s *bState) { - s.sortDecorators(decorators) + s.populateEwmaDecorators(decorators) s.decorators[0] = decorators } } @@ -33,7 +33,7 @@ func PrependDecorators(decorators ...decor.Decorator) BarOption { func AppendDecorators(decorators ...decor.Decorator) BarOption { decorators = inspect(decorators) return func(s *bState) { - s.sortDecorators(decorators) + s.populateEwmaDecorators(decorators) s.decorators[1] = decorators } }