Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: İnanç Gümüş <[email protected]>
  • Loading branch information
ankur22 and inancgumus authored Oct 6, 2022
1 parent 5d55090 commit 5c3e2fd
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions common/event_emitter.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ type NavigationEvent struct {
type eventHandler struct {
ctx context.Context
ch chan Event
queueMutex *sync.Mutex
queueMutex sync.Mutex
queue []Event
curQueueMutex *sync.Mutex
curQueueMutex sync.Mutex
curQueue []Event
}

Expand Down Expand Up @@ -242,14 +242,6 @@ func (e *BaseEventEmitter) on(ctx context.Context, events []string, ch chan Even
// OnAll registers a handler for all events.
func (e *BaseEventEmitter) onAll(ctx context.Context, ch chan Event) {
e.sync(func() {
e.handlersAll = append(e.handlersAll,
&eventHandler{
ctx,
ch,
&sync.Mutex{},
make([]Event, 0),
&sync.Mutex{},
make([]Event, 0),
})
e.handlersAll = append(e.handlersAll, &eventHandler{ctx: ctx, ch: ch})
})
}

0 comments on commit 5c3e2fd

Please sign in to comment.