ICSharpCode.SharpZipLib.Zip.ZipFile.UpdateComparer C# (CSharp) Method

UpdateComparer() private static method

Compares two objects and returns a value indicating whether one is less than, equal to or greater than the other.
private static UpdateComparer ( ZipUpdate zx, ZipUpdate zy ) : int
zx ZipUpdate First object to compare
zy ZipUpdate Second object to compare.
return int
        private static int UpdateComparer(
            ZipUpdate zx,
            ZipUpdate zy) {

            int result;

            if (zx==null) {
                if (zy==null) {
                    result=0;
                } else {
                    result=-1;
                }
            } else if (zy==null) {
                result=1;
            } else {
                int xCmdValue=((zx.Command==UpdateCommand.Copy)||(zx.Command==UpdateCommand.Modify))?0:1;
                int yCmdValue=((zy.Command==UpdateCommand.Copy)||(zy.Command==UpdateCommand.Modify))?0:1;

                result=xCmdValue-yCmdValue;
                if (result==0) {
                    long offsetDiff=zx.Entry.Offset-zy.Entry.Offset;
                    if (offsetDiff<0) {
                        result=-1;
                    } else if (offsetDiff==0) {
                        result=0;
                    } else {
                        result=1;
                    }
                }
            }
            return result;
        }