Skip to content

Commit

Permalink
Merge pull request #317 from kiwicom/ms/producer-code-readability
Browse files Browse the repository at this point in the history
producer: improve code readability
  • Loading branch information
mreiferson authored Jan 17, 2021
2 parents b933d01 + 6d8e101 commit 63a3a23
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions producer.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,11 @@ func (w *Producer) connect() error {
return ErrStopped
}

switch state := atomic.LoadInt32(&w.state); state {
case StateInit:
case StateConnected:
state := atomic.LoadInt32(&w.state)
switch {
case state == StateConnected:
return nil
default:
case state != StateInit:
return ErrNotConnected
}

Expand Down

0 comments on commit 63a3a23

Please sign in to comment.