Merge pull request #5617 from liggitt/preallocation

fileutil: avoid double preallocation
This commit is contained in:
Anthony Romano 2016-06-09 22:27:17 -07:00 committed by GitHub
commit bdc7035c10

View File

@ -23,7 +23,7 @@ import "os"
// Otherwise, the error encountered will be returned.
func Preallocate(f *os.File, sizeInBytes int64, extendFile bool) error {
if extendFile {
preallocExtend(f, sizeInBytes)
return preallocExtend(f, sizeInBytes)
}
return preallocFixed(f, sizeInBytes)
}