Skip to content

Commit

Permalink
Remove pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
chdxD1 committed Jul 4, 2023
1 parent f1ba2dd commit 60ab675
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/debounce/debounce.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
// Debouncer struct
type Debouncer struct {
// Used for atomic operations
scheduled *atomic.Bool
calledDuringExecution *atomic.Bool
scheduled atomic.Bool
calledDuringExecution atomic.Bool
// Stores the function as an interface so we can use reflect
function func(context.Context) error
// Duration between function call
Expand All @@ -22,10 +22,8 @@ type Debouncer struct {
// Create a new debouncer
func NewDebouncer(function func(context.Context) error, debounceTime time.Duration) *Debouncer {
return &Debouncer{
scheduled: &atomic.Bool{},
calledDuringExecution: &atomic.Bool{},
function: function,
debounceTime: debounceTime,
function: function,
debounceTime: debounceTime,
}
}

Expand Down

0 comments on commit 60ab675

Please sign in to comment.