/// <inheritdoc /> public int Compare(FileArtifact x, FileArtifact y) { var pathCompare = m_pathComparer.Compare(x.Path, y.Path); return(pathCompare != 0 || m_pathOnly ? pathCompare : (x.RewriteCount - y.RewriteCount)); }
/// <summary> /// Compares this object to another for purposes of ordering. /// </summary> /// <param name="other">Other File artifact to compare against.</param> /// <param name="comparer">Path comparer to compare file paths</param> /// <param name="pathOnly">If false, also compare rewrite count and file existence</param> /// <returns>0 if the objects are equal, postitive or negative number depending on which object comes first.</returns> public int CompareTo(FileArtifactWithAttributes other, PathTable.ExpandedAbsolutePathComparer comparer, bool pathOnly) { var pathCompare = comparer.Compare(Path, other.Path); return(pathCompare != 0 || pathOnly ? pathCompare : (((int)m_rewriteCountAndFileExistence) - ((int)other.m_rewriteCountAndFileExistence))); }
/// <inheritdoc /> public int Compare(DirectoryArtifact x, DirectoryArtifact y) { var pathCompare = m_pathComparer.Compare(x.Path, y.Path); return(pathCompare != 0 || m_pathOnly ? pathCompare : ((x.IsSharedOpaque ? 1 : 0) - (y.IsSharedOpaque ? 1 : 0))); }