public int CompareTo(HFSExtentKey?other) { if (other is null) { return(1); } int result = FileId.CompareTo(other.FileId); if (result == 0) { result = ForkType.CompareTo(other.ForkType); } if (result == 0) { result = StartBlock.CompareTo(other.StartBlock); } return(result); }
/// <summary> /// Compares the current object with another object of the same type. /// </summary> /// <param name="other">An object to compare with this object.</param> /// <returns> /// A 32-bit signed integer that indicates the relative order of the objects being compared. /// The return value has the following meanings: Value Meaning Less than zero This object is less than the <paramref name="other"/> /// parameter. /// Zero This object is equal to <paramref name="other"/>. Greater than zero This object is greater than <paramref name="other"/>. /// </returns> public int CompareTo(PageAddress other) { return((FileId.CompareTo(other.FileId) * 9999999) + PageId.CompareTo(other.PageId)); }