set_fast.go 476 B

12345678910111213141516171819202122232425
  1. // Copyright (C) 2014 Jakob Borg and other contributors. All rights reserved.
  2. // Use of this source code is governed by an MIT-style license that can be
  3. // found in the LICENSE file.
  4. //+build !anal
  5. package files
  6. import "github.com/calmh/syncthing/scanner"
  7. type key struct {
  8. Name string
  9. Version uint64
  10. }
  11. func keyFor(f scanner.File) key {
  12. return key{
  13. Name: f.Name,
  14. Version: f.Version,
  15. }
  16. }
  17. func (a key) newerThan(b key) bool {
  18. return a.Version > b.Version
  19. }