Skip to content

Commit

Permalink
add version for file system
Browse files Browse the repository at this point in the history
  • Loading branch information
njuCZ committed May 29, 2020
1 parent ec60691 commit c7060ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/filesystem/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ func (f *file) Version() int {
return f.version
}

func (f *file) IncrementVersion() {
f.version += 1
func (f *file) SetVersion(version int) {
f.version = version
}

func (f *file) Lines() source.Lines {
Expand Down
3 changes: 1 addition & 2 deletions internal/filesystem/filesystem.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ func (fs *fsystem) Change(fh VersionedFileHandler, changes FileChanges) error {
for _, change := range changes {
f.applyChange(change)
}

f.IncrementVersion()
f.SetVersion(fh.Version())
return nil
}

Expand Down

0 comments on commit c7060ce

Please sign in to comment.