On Mon, 21 Oct 2024 12:00:17 GMT, Naveen Narayanan <[email protected]> wrote:
>> test/jdk/java/awt/Robot/ScreenCaptureRobotTest.java line 119: >> >>> 117: >>> 118: imgWidth = capturedImg.getWidth(null); >>> 119: imgHeight = capturedImg.getHeight(null); >> >> These variables can be removed and `capturedImg.getWidth(null)` should >> replace `imgWidth` in for-loop condition. same for `imgHeight` also. > > @kumarabhi006 > In that case, > capturedImg.getWidth(null); > capturedImg.getHeight(null) > will be calculated in every iteration of for loops right. > May be an extra Memory/Processor burden ? If you declare the size of the image as constants, you will always know the size of the images. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21524#discussion_r1808844638
