Archived
Remove SyncOrder, at least temporarily (sorry fREW)
Doesn't actually work very well with the batched approach to needed files, not documented, not exposed in UI. I'll be happy to reintegrate if this is solved.
This commit is contained in:
1 parent
28f2e8f24d
commit
75d4d2df8b
4 files changed
+7
-177
No files matched your search
@@ -1,33 +0,0 @@
|
||||
package files
|
||||
|
||||
import (
|
||||
"github.com/calmh/syncthing/protocol"
|
||||
"sort"
|
||||
)
|
||||
|
||||
type SortBy func(p protocol.FileInfo) int
|
||||
|
||||
func (by SortBy) Sort(files []protocol.FileInfo) {
|
||||
ps := &fileSorter{
|
||||
files: files,
|
||||
by: by,
|
||||
}
|
||||
sort.Sort(ps)
|
||||
}
|
||||
|
||||
type fileSorter struct {
|
||||
files []protocol.FileInfo
|
||||
by func(p1 protocol.FileInfo) int
|
||||
}
|
||||
|
||||
func (s *fileSorter) Len() int {
|
||||
return len(s.files)
|
||||
}
|
||||
|
||||
func (s *fileSorter) Swap(i, j int) {
|
||||
s.files[i], s.files[j] = s.files[j], s.files[i]
|
||||
}
|
||||
|
||||
func (s *fileSorter) Less(i, j int) bool {
|
||||
return s.by(s.files[i]) > s.by(s.files[j])
|
||||
}
|
||||
Reference in new issue
Block a user