Skip to content

Commit

Permalink
Optimize size of BufferedWriteSyncer by moving stopped bool field (#984)
Browse files Browse the repository at this point in the history
Keeping the 2 `bool` fields next to each other avoids wasting an additional word.
  • Loading branch information
lancoLiu authored Jul 30, 2021
1 parent 81879d1 commit 2198a43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zapcore/buffered_write_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ type BufferedWriteSyncer struct {
// unexported fields for state
mu sync.Mutex
initialized bool // whether initialize() has run
stopped bool // whether Stop() has run
writer *bufio.Writer
ticker *time.Ticker
stop chan struct{} // closed when flushLoop should stop
stopped bool // whether Stop() has run
done chan struct{} // closed when flushLoop has stopped
}

Expand Down

0 comments on commit 2198a43

Please sign in to comment.