Skip to content

Commit 5042c37

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 0cef3a6 commit 5042c37

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
@@ -526,10 +526,10 @@ func (b *Buffer) Close() {
526526
// Fini should be called when a buffer is closed and performs
527527
// some cleanup
528528
func (b *Buffer) Fini() {
529-
if !b.Modified() {
530-
b.Serialize()
531-
}
532529
if !b.Shared() {
530+
if !b.Modified() {
531+
b.Serialize()
532+
}
533533
b.CancelBackup()
534534
}
535535

0 commit comments

Comments
 (0)