Skip to content

Commit

Permalink
remove state change after Flush
Browse files Browse the repository at this point in the history
A call do Flush does not necessarily mean that the state should
change.  Another write could come in, if the state is closed this
can't occur.  Another Write can come in, it just needs to be a new
block.
  • Loading branch information
leehinman committed Jun 15, 2022
1 parent 885e900 commit 8582079
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion writer.go
Expand Up @@ -153,7 +153,7 @@ func (w *Writer) Flush() (err error) {
default:
return nil
}
defer w.state.nextd(&err)

if w.idx > 0 {
// Flush pending data, disable w.data freeing as it is done later on.
if err = w.write(w.data[:w.idx], false); err != nil {
Expand Down

0 comments on commit 8582079

Please sign in to comment.