lib/model, lib/protocol: Remove FileInfoBatch reuse behavior (#9399)

This commit is contained in:
Jakob Borg
2024-02-10 19:16:27 +01:00
committed by GitHub
parent fc8b353011
commit 96c30f8387
4 changed files with 120 additions and 20 deletions
+4 -10
View File
@@ -14,25 +14,19 @@ type wireFormatConnection struct {
}
func (c wireFormatConnection) Index(ctx context.Context, folder string, fs []FileInfo) error {
var myFs = make([]FileInfo, len(fs))
copy(myFs, fs)
for i := range fs {
myFs[i].Name = norm.NFC.String(filepath.ToSlash(myFs[i].Name))
fs[i].Name = norm.NFC.String(filepath.ToSlash(fs[i].Name))
}
return c.Connection.Index(ctx, folder, myFs)
return c.Connection.Index(ctx, folder, fs)
}
func (c wireFormatConnection) IndexUpdate(ctx context.Context, folder string, fs []FileInfo) error {
var myFs = make([]FileInfo, len(fs))
copy(myFs, fs)
for i := range fs {
myFs[i].Name = norm.NFC.String(filepath.ToSlash(myFs[i].Name))
fs[i].Name = norm.NFC.String(filepath.ToSlash(fs[i].Name))
}
return c.Connection.IndexUpdate(ctx, folder, myFs)
return c.Connection.IndexUpdate(ctx, folder, fs)
}
func (c wireFormatConnection) Request(ctx context.Context, folder string, name string, blockNo int, offset int64, size int, hash []byte, weakHash uint32, fromTemporary bool) ([]byte, error) {