diff options
author | 2018-07-23 18:16:18 -0700 | |
---|---|---|
committer | 2018-07-23 18:18:36 -0700 | |
commit | dd9f60e4d2721cdfd3044a8c8a1bdfd8e444009c (patch) | |
tree | 40d209283f1aec518fc57d7c07001a13bbabe1e3 /src/main/java/com/google/devtools/build/lib/unix | |
parent | 69301af7fdf8be97627bddeb33224289ebe4de93 (diff) |
Remove redundancy in DigestHashFunction use in FileSystem.
Each FileSystem instance has a digest function, but the getDigest and getHashDigest functions also accepted their own custom parameter functions. We only support 1 hash per filesystem instance, these parameters are redundant.
RELNOTES: None.
PiperOrigin-RevId: 205758571
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/unix')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java b/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java index 16d44a1dff..5d507c3f95 100644 --- a/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java +++ b/src/main/java/com/google/devtools/build/lib/unix/UnixFileSystem.java @@ -399,14 +399,14 @@ public class UnixFileSystem extends AbstractFileSystemWithCustomStat { } @Override - protected byte[] getDigest(Path path, DigestHashFunction hashFunction) throws IOException { + protected byte[] getDigest(Path path) throws IOException { String name = path.toString(); long startTime = Profiler.nanoTimeMaybe(); try { - if (hashFunction == DigestHashFunction.MD5) { + if (getDigestFunction() == DigestHashFunction.MD5) { return NativePosixFiles.md5sum(name).asBytes(); } - return super.getDigest(path, hashFunction); + return super.getDigest(path); } finally { profiler.logSimpleTask(startTime, ProfilerTask.VFS_MD5, name); } |