Faster and leaner comparisons in fileset

This commit is contained in:
Jakob Borg
2014-04-13 14:30:40 +02:00
parent e974c8f33e
commit 41c228cb56
3 changed files with 69 additions and 39 deletions

21
files/set_fast.go Normal file
View File

@@ -0,0 +1,21 @@
//+build !anal
package files
import "github.com/calmh/syncthing/scanner"
type key struct {
Name string
Version uint64
}
func keyFor(f scanner.File) key {
return key{
Name: f.Name,
Version: f.Version,
}
}
func (a key) newerThan(b key) bool {
return a.Version > b.Version
}