mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8210347: Combine subsequent calls to Set.contains() and Set.add()
Reviewed-by: smarks, bpb
This commit is contained in:
parent
9118c4c28b
commit
475d422094
4 changed files with 6 additions and 10 deletions
|
@ -601,8 +601,7 @@ public final class Configuration {
|
|||
// push in reverse order
|
||||
for (int i = layer.parents.size() - 1; i >= 0; i--) {
|
||||
Configuration parent = layer.parents.get(i);
|
||||
if (!visited.contains(parent)) {
|
||||
visited.add(parent);
|
||||
if (visited.add(parent)) {
|
||||
stack.push(parent);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue