diff options
author | 2016-03-14 16:19:18 +0000 | |
---|---|---|
committer | 2016-03-15 11:58:51 +0000 | |
commit | ce372c36a3c1c90197a69bb2f3870babfc1eef5e (patch) | |
tree | 820f8c9767a6b2d25311f0038ab1ea215f9ab997 /src/main/java/com/google/devtools/build/lib/vfs/Dirent.java | |
parent | bde58449d2ef8eddce5058e40b41b23ff4aefd63 (diff) |
Roll-forward of commit 4bf0018ed1cf8616297b951dc03dbde3f0db2503 with code to preserve order of glob matches: Parallelize fetches of symlink file values, subdirectory globs, and subdirectory package lookup values. This should improve change pruning speed when we have to check a glob. It also keeps GlobFunction closer to the contract of Skyframe, because in order to avoid quadratic restarts, it wasn't checking for missing deps between getValue calls.
--
MOS_MIGRATED_REVID=117139471
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/vfs/Dirent.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/vfs/Dirent.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/Dirent.java b/src/main/java/com/google/devtools/build/lib/vfs/Dirent.java index d76756dd9c..c62ff442bc 100644 --- a/src/main/java/com/google/devtools/build/lib/vfs/Dirent.java +++ b/src/main/java/com/google/devtools/build/lib/vfs/Dirent.java @@ -18,11 +18,8 @@ import com.google.devtools.build.lib.util.Preconditions; import java.io.Serializable; import java.util.Objects; -/** - * Directory entry representation returned by {@link Path#readdir}. - */ -public class Dirent implements Serializable { - +/** Directory entry representation returned by {@link Path#readdir}. */ +public final class Dirent implements Serializable, Comparable<Dirent> { /** Type of the directory entry */ public enum Type { // A regular file. @@ -73,4 +70,9 @@ public class Dirent implements Serializable { public String toString() { return name + "[" + type.toString().toLowerCase() + "]"; } + + @Override + public int compareTo(Dirent other) { + return this.getName().compareTo(other.getName()); + } } |