Skip to content

Commit

Permalink
[chore] reuse the timer object when parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
atoulme committed Mar 20, 2024
1 parent 74170c0 commit 069485b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pkg/stanza/operator/helper/time.go
Expand Up @@ -47,12 +47,11 @@ type TimeParser struct {

// Unmarshal starting from default settings
func (t *TimeParser) Unmarshal(component *confmap.Conf) error {
cfg := NewTimeParser()
err := component.Unmarshal(&cfg, confmap.WithIgnoreUnused())
*t = NewTimeParser()
err := component.Unmarshal(t, confmap.WithIgnoreUnused())
if err != nil {
return err
}
*t = cfg
return nil
}

Expand Down

0 comments on commit 069485b

Please sign in to comment.