Merge pull request #2698 from guo-sj/fix_bugs_in_return_value

This commit is contained in:
Chris Lu 2022-02-23 00:41:30 -08:00 committed by GitHub
commit da58c748bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -399,7 +399,7 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
dataFile *os.File dataFile *os.File
) )
if dstDatBackend, err = backend.CreateVolumeFile(dstDatName, preallocate, 0); err != nil { if dstDatBackend, err = backend.CreateVolumeFile(dstDatName, preallocate, 0); err != nil {
return return err
} }
defer dstDatBackend.Close() defer dstDatBackend.Close()
@ -408,7 +408,7 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
newNm := needle_map.NewMemDb() newNm := needle_map.NewMemDb()
defer newNm.Close() defer newNm.Close()
if err = oldNm.LoadFromIdx(srcIdxName); err != nil { if err = oldNm.LoadFromIdx(srcIdxName); err != nil {
return return err
} }
if dataFile, err = os.Open(srcDatName); err != nil { if dataFile, err = os.Open(srcDatName); err != nil {
return err return err
@ -464,5 +464,5 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
newNm.SaveToIdx(datIdxName) newNm.SaveToIdx(datIdxName)
return return nil
} }