8357688: Remove unnecessary List.get before remove in PopupFactory
Reviewed-by: azvegint, kizune, serb
This commit is contained in:
parent
fe3be498b8
commit
15178aa298
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1999, 2023, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
@ -433,10 +433,8 @@ public class PopupFactory {
|
|||||||
} else {
|
} else {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (cache.size() > 0) {
|
if (!cache.isEmpty()) {
|
||||||
HeavyWeightPopup r = cache.get(0);
|
return cache.removeFirst();
|
||||||
cache.remove(0);
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -776,10 +774,8 @@ public class PopupFactory {
|
|||||||
private static LightWeightPopup getRecycledLightWeightPopup() {
|
private static LightWeightPopup getRecycledLightWeightPopup() {
|
||||||
synchronized (LightWeightPopup.class) {
|
synchronized (LightWeightPopup.class) {
|
||||||
List<LightWeightPopup> lightPopupCache = getLightWeightPopupCache();
|
List<LightWeightPopup> lightPopupCache = getLightWeightPopupCache();
|
||||||
if (lightPopupCache.size() > 0) {
|
if (!lightPopupCache.isEmpty()) {
|
||||||
LightWeightPopup r = lightPopupCache.get(0);
|
return lightPopupCache.removeFirst();
|
||||||
lightPopupCache.remove(0);
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -934,10 +930,8 @@ public class PopupFactory {
|
|||||||
private static MediumWeightPopup getRecycledMediumWeightPopup() {
|
private static MediumWeightPopup getRecycledMediumWeightPopup() {
|
||||||
synchronized (MediumWeightPopup.class) {
|
synchronized (MediumWeightPopup.class) {
|
||||||
List<MediumWeightPopup> mediumPopupCache = getMediumWeightPopupCache();
|
List<MediumWeightPopup> mediumPopupCache = getMediumWeightPopupCache();
|
||||||
if (mediumPopupCache.size() > 0) {
|
if (!mediumPopupCache.isEmpty()) {
|
||||||
MediumWeightPopup r = mediumPopupCache.get(0);
|
return mediumPopupCache.removeFirst();
|
||||||
mediumPopupCache.remove(0);
|
|
||||||
return r;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user