Skip to content

Commit b7e3e4f

Browse files
haxorzcopybara-github
authored andcommitted
Factor out PathFragment.create("_repo_mapping") to a constant.
No need to create a new instance each time we call `Runfiles#getRunfilesInputs`. PiperOrigin-RevId: 671470371 Change-Id: Ia168ab7a15e810f55381094db20301ac5373382a
1 parent c341c65 commit b7e3e4f

File tree

1 file changed

+4
-1
lines changed
  • src/main/java/com/google/devtools/build/lib/analysis

1 file changed

+4
-1
lines changed

src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ public void fingerprint(Fingerprint fp) {
9494
// It is important to declare this *after* the DUMMY_SYMLINK_EXPANDER to avoid NPEs
9595
public static final Runfiles EMPTY = new Builder().build();
9696

97+
private static final PathFragment REPO_MAPPING_PATH_FRAGMENT =
98+
PathFragment.create("_repo_mapping");
99+
97100
private static final CommandLineItem.ExceptionlessMapFn<SymlinkEntry> SYMLINK_ENTRY_MAP_FN =
98101
(symlink, args) -> {
99102
args.accept(symlink.getPathString());
@@ -375,7 +378,7 @@ public Map<PathFragment, Artifact> getRunfilesInputs(
375378
}
376379
builder.add(getRootSymlinksAsMap(checker), checker);
377380
if (repoMappingManifest != null) {
378-
checker.put(builder.manifest, PathFragment.create("_repo_mapping"), repoMappingManifest);
381+
checker.put(builder.manifest, REPO_MAPPING_PATH_FRAGMENT, repoMappingManifest);
379382
}
380383
return builder.build();
381384
}

0 commit comments

Comments
 (0)