Skip to content

Commit 9751497

Browse files
ptzieglerakurtakov
authored andcommitted
Avoid unnecessary Point creation in ImageDataAtSizeProvider
We can directly check the x and y coordinates of the default size, which avoids any additional noise for the JVM GC.
1 parent 8da42cd commit 9751497

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageDataAtSizeProvider.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface ImageDataAtSizeProvider extends ImageDataProvider {
4545
@Override
4646
default ImageData getImageData(int zoom) {
4747
Point defaultSize = getDefaultSize();
48-
if (new Point(-1, -1).equals(defaultSize)) {
48+
if (defaultSize.x == -1 && defaultSize.y == -1) {
4949
if (zoom == 100) {
5050
return new ImageData(1, 1, 32, new PaletteData(0xFF0000, 0xFF00, 0xFF));
5151
}

0 commit comments

Comments
 (0)