Skip to content

Commit 8b3e5ea

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 9f9ef79 commit 8b3e5ea

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

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)