Skip to content

Commit 20b5f09

Browse files
author
Andrey Turbanov
committed
8357226: Remove unnecessary List.indexOf from RepaintManager.removeInvalidComponent
Reviewed-by: azvegint, serb
1 parent 3b44d7b commit 20b5f09

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/java.desktop/share/classes/javax/swing/RepaintManager.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -389,11 +389,8 @@ public synchronized void removeInvalidComponent(JComponent component) {
389389
delegate.removeInvalidComponent(component);
390390
return;
391391
}
392-
if(invalidComponents != null) {
393-
int index = invalidComponents.indexOf(component);
394-
if(index != -1) {
395-
invalidComponents.remove(index);
396-
}
392+
if (invalidComponents != null) {
393+
invalidComponents.remove(component);
397394
}
398395
}
399396

0 commit comments

Comments
 (0)