Skip to content

Commit

Permalink
Set fastdirty on for files larger than 50kb
Browse files Browse the repository at this point in the history
  • Loading branch information
zyedidia committed Sep 24, 2017
1 parent 12a4dd5 commit a5e721b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/micro/buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ func NewBuffer(reader io.Reader, size int64, path string) *Buffer {
}

if !b.Settings["fastdirty"].(bool) {
b.origHash = md5.Sum([]byte(b.String()))
if size > 50000 {
// If the file is larger than a megabyte fastdirty needs to be on

This comment has been minimized.

Copy link
@OutOfBrain

OutOfBrain Sep 29, 2017

Think the comment is wrong

b.Settings["fastdirty"] = true
} else {
b.origHash = md5.Sum([]byte(b.String()))
}
}

b.cursors = []*Cursor{&b.Cursor}
Expand Down

0 comments on commit a5e721b

Please sign in to comment.