Skip to content

Commit a7840b2

Browse files
committed
buffer: Don't Serialize in case the buffer is shared
Otherwise we do unnecessarily serialize per shared buffer as well as storing multiple cursor states, while only the last one will be restored anyway.
1 parent ea59a85 commit a7840b2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/buffer/buffer.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -531,10 +531,10 @@ func (b *Buffer) Close() {
531531
// Fini should be called when a buffer is closed and performs
532532
// some cleanup
533533
func (b *Buffer) Fini() {
534-
if !b.Modified() {
535-
b.Serialize()
536-
}
537534
if !b.Shared() {
535+
if !b.Modified() {
536+
b.Serialize()
537+
}
538538
b.CancelBackup()
539539
}
540540

0 commit comments

Comments
 (0)