From 8582079abcd01a8243fc7d29eea6e5f4aa875e7f Mon Sep 17 00:00:00 2001 From: "Lee E. Hinman" Date: Tue, 14 Jun 2022 20:28:59 -0500 Subject: [PATCH] remove state change after Flush 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. --- writer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/writer.go b/writer.go index 140a3b9..77699f2 100644 --- a/writer.go +++ b/writer.go @@ -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 {