From 3e09b6dad4e90c4a2bcc97b393f3096f7abf2d8d Mon Sep 17 00:00:00 2001 From: Petter Rasmussen Date: Tue, 2 Feb 2016 22:34:42 +0100 Subject: s/byPathLength/byLocalPathLength/ --- drive/download_sync.go | 2 +- drive/upload_sync.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drive') diff --git a/drive/download_sync.go b/drive/download_sync.go index c4bd977..5fb88ab 100644 --- a/drive/download_sync.go +++ b/drive/download_sync.go @@ -202,7 +202,7 @@ func (self *Drive) deleteExtraneousLocalFiles(files *syncFiles, args DownloadSyn } // Sort files so that the files with the longest path comes first - sort.Sort(sort.Reverse(byPathLength(extraneousFiles))) + sort.Sort(sort.Reverse(byLocalPathLength(extraneousFiles))) for i, lf := range extraneousFiles { fmt.Fprintf(args.Out, "[%04d/%04d] Deleting %s\n", i + 1, extraneousCount, lf.absPath) diff --git a/drive/upload_sync.go b/drive/upload_sync.go index 081f739..ed1e7a7 100644 --- a/drive/upload_sync.go +++ b/drive/upload_sync.go @@ -155,7 +155,7 @@ func (self *Drive) createMissingRemoteDirs(files *syncFiles, args UploadSyncArgs } // Sort directories so that the dirs with the shortest path comes first - sort.Sort(byPathLength(missingDirs)) + sort.Sort(byLocalPathLength(missingDirs)) for i, lf := range missingDirs { parentPath := parentFilePath(lf.relPath) @@ -629,17 +629,17 @@ func (self *syncFiles) findLocalByPath(relPath string) (*localFile, bool) { return nil, false } -type byPathLength []*localFile +type byLocalPathLength []*localFile -func (self byPathLength) Len() int { +func (self byLocalPathLength) Len() int { return len(self) } -func (self byPathLength) Swap(i, j int) { +func (self byLocalPathLength) Swap(i, j int) { self[i], self[j] = self[j], self[i] } -func (self byPathLength) Less(i, j int) bool { +func (self byLocalPathLength) Less(i, j int) bool { return pathLength(self[i].relPath) < pathLength(self[j].relPath) } -- cgit v1.2.3