Add ActionInput.getExecPath, which returns a PathFragment
Update some callers to use getExecPath, which generally results in less
intermediate garbage generation (almost all callers need a PathFragment, not
a String).
Another small step towards #1593.
--
PiperOrigin-RevId: 150631279
MOS_MIGRATED_REVID=150631279
diff --git a/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java b/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java
index 4ca4a1b..c63fd5b 100644
--- a/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/actions/ActionInputHelper.java
@@ -69,6 +69,7 @@
*/
private static class BasicActionInput implements ActionInput {
private final String path;
+
public BasicActionInput(String path) {
this.path = Preconditions.checkNotNull(path);
}
@@ -79,6 +80,11 @@
}
@Override
+ public PathFragment getExecPath() {
+ return new PathFragment(path);
+ }
+
+ @Override
public int hashCode() {
return path.hashCode();
}