From 7812bdce946578e8630af433d78ac2a0e8b8cb2f Mon Sep 17 00:00:00 2001 From: emilyguo Date: Mon, 21 Mar 2022 06:38:08 -0700 Subject: [PATCH] Add checking value is null in `declareDependenciesAndCheckValues`. Return earlier if any value is missing, don't need to iterate over. PiperOrigin-RevId: 436189630 --- .../devtools/build/lib/skyframe/BuildDriverFunction.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java index 96c5d3e8fd0dfa..154e0d0daa62b2 100644 --- a/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java +++ b/src/main/java/com/google/devtools/build/lib/skyframe/BuildDriverFunction.java @@ -218,7 +218,9 @@ private static void declareDependenciesAndCheckValues( Environment env, Iterable skyKeys) throws InterruptedException { SkyframeIterableResult result = env.getOrderedValuesAndExceptions(skyKeys); while (result.hasNext()) { - result.next(); + if (result.next() == null) { + return; + } } }