From ad28fd1ecb3fc88957f2861c91066f176a884f8d Mon Sep 17 00:00:00 2001 From: Christian Schwarz Date: Sun, 2 Sep 2018 15:31:10 -0700 Subject: [PATCH] replication: diff does not need special case for receiver/sender == nil --- replication/internal/diff/diff.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/replication/internal/diff/diff.go b/replication/internal/diff/diff.go index fed2392..213bc77 100644 --- a/replication/internal/diff/diff.go +++ b/replication/internal/diff/diff.go @@ -49,20 +49,9 @@ func SortVersionListByCreateTXGThenBookmarkLTSnapshot(fsvslice []*FilesystemVers // conflict may be a *ConflictDiverged or a *ConflictNoCommonAncestor func IncrementalPath(receiver, sender []*FilesystemVersion) (incPath []*FilesystemVersion, conflict error) { - if receiver == nil { - panic("receiver must not be nil") - } - if sender == nil { - panic("sender must not be nil") - } - receiver = SortVersionListByCreateTXGThenBookmarkLTSnapshot(receiver) sender = SortVersionListByCreateTXGThenBookmarkLTSnapshot(sender) - if len(sender) == 0 { - return []*FilesystemVersion{}, nil - } - // Find most recent common ancestor by name, preferring snapshots over bookmarks mrcaRcv := len(receiver) - 1