Pass PathFragment for "offset" in target patterns, rather than a raw string. Since the PathFragment wraps a String anyway, calling PathFragment#getPathString repeatedly should be fine from a performance standpoint, and the code is clearer this way.
Get rid of WalkableGraphFactory#getUniverseKey since it would have required adding a dependency on PathFragment from core Skyframe. Instead, have the UniverseScope, which is already in charge of determining the list of patterns, just return the key.
This should be a no-op behavior-wise.
PiperOrigin-RevId: 330987233
diff --git a/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsFunctionSmartNegationTest.java b/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsFunctionSmartNegationTest.java
index bcd67b9..b025695 100644
--- a/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsFunctionSmartNegationTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skyframe/PrepareDepsOfPatternsFunctionSmartNegationTest.java
@@ -210,7 +210,8 @@
private WalkableGraph getGraphFromPatternsEvaluation(
ImmutableList<String> patternSequence, boolean successExpected, boolean keepGoing)
throws InterruptedException {
- SkyKey independentTarget = PrepareDepsOfPatternsValue.key(patternSequence, "");
+ SkyKey independentTarget =
+ PrepareDepsOfPatternsValue.key(patternSequence, PathFragment.EMPTY_FRAGMENT);
ImmutableList<SkyKey> singletonTargetPattern = ImmutableList.of(independentTarget);
// When PrepareDepsOfPatternsFunction completes evaluation,