2
Vote

DirectoryDiff.cs

description

line 58
                var ritem = new DirectoryDiffResultItem();

                if (right == null)
                {                    
                    // right list is at end, all left items are missing
                    ritem.localItem = localFiles.Values.ElementAt(i);
                    ritem.remoteItem = null;
                    ritem.compareResult = ComparisonResult.MissingInRemoteFolder;

                    // increase local
                    i++;
                }
                else if (left == null)
                {
                    // left list is at end, all rightitems are missing
                    ritem.localItem = null;
                    ritem.remoteItem = remoteFiles.Values.ElementAt(j);
                    ritem.compareResult = ComparisonResult.MissingInLocalFolder;

                    // increase remote
                    j++;
                }
       if (left == null && right == null)
                break;

            var ritem = new DirectoryDiffResultItem();

            if (right == null && i < localFiles.Values.Count)
            {                    
                // right list is at end, all left items are missing
                ritem.localItem = localFiles.Values.ElementAt(i);
                ritem.remoteItem = null;
                ritem.compareResult = ComparisonResult.MissingInRemoteFolder;

                // increase local
                i++;
            }
            else if (left == null && j < remoteFiles.Values.Count)
            {
                // left list is at end, all rightitems are missing
                ritem.localItem = null;
                ritem.remoteItem = remoteFiles.Values.ElementAt(j);
                ritem.compareResult = ComparisonResult.MissingInLocalFolder;

                // increase remote
                j++;
            }

comments