Skip to content

Commit d0926c0

Browse files
committed
Auto merge of #151540 - Zoxc:color-get-opt, r=<try>
Tweak bounds check in `DepNodeColorMap.get`
2 parents f66622c + a262ec8 commit d0926c0

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_middle/src/dep_graph

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/dep_graph/graph.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ impl DepNodeColorMap {
14471447
let value = self.values[index].load(Ordering::Acquire);
14481448
// Green is by far the most common case. Check for that first so we can succeed with a
14491449
// single comparison.
1450-
if value < COMPRESSED_RED {
1450+
if value <= DepNodeIndex::MAX_AS_U32 {
14511451
DepNodeColor::Green(DepNodeIndex::from_u32(value))
14521452
} else if value == COMPRESSED_RED {
14531453
DepNodeColor::Red

0 commit comments

Comments
 (0)