mirror of
https://github.com/openjdk/jdk.git
synced 2026-02-16 13:25:34 +00:00
8357224: Avoid redundant WeakHashMap.get in Toolkit.removeAWTEventListener
Reviewed-by: liach, aivanov, serb
This commit is contained in:
parent
91194517c7
commit
a0cdf36bdf
@ -1632,7 +1632,7 @@ public abstract class Toolkit {
|
||||
private int[] calls = new int[LONG_BITS];
|
||||
private static volatile long enabledOnToolkitMask;
|
||||
private AWTEventListener eventListener = null;
|
||||
private WeakHashMap<AWTEventListener, SelectiveAWTEventListener> listener2SelectiveListener = new WeakHashMap<>();
|
||||
private final WeakHashMap<AWTEventListener, SelectiveAWTEventListener> listener2SelectiveListener = new WeakHashMap<>();
|
||||
|
||||
/*
|
||||
* Extracts a "pure" AWTEventListener from a AWTEventListenerProxy,
|
||||
@ -1741,10 +1741,9 @@ public abstract class Toolkit {
|
||||
|
||||
synchronized (this) {
|
||||
SelectiveAWTEventListener selectiveListener =
|
||||
listener2SelectiveListener.get(localL);
|
||||
listener2SelectiveListener.remove(localL);
|
||||
|
||||
if (selectiveListener != null) {
|
||||
listener2SelectiveListener.remove(localL);
|
||||
int[] listenerCalls = selectiveListener.getCalls();
|
||||
for (int i=0; i<LONG_BITS; i++) {
|
||||
calls[i] -= listenerCalls[i];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user