lib/osutil: Remove unnecessary fsync in Copy()

Fsyncing the file has a small performance penalty and seems unnecessary. The
file will be fsynced anyway, when the changes are commited to the database.

GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3749
This commit is contained in:
Unrud 2016-11-22 07:59:54 +00:00 committed by Jakob Borg
parent cc9a9fb390
commit f1e83a57cd

View File

@ -172,10 +172,7 @@ func copyFileContents(src, dst string) (err error) {
err = cerr
}
}()
if _, err = io.Copy(out, in); err != nil {
return
}
err = out.Sync()
_, err = io.Copy(out, in)
return
}