[OpenJDK 2D-Dev] RFR: 8264666: Reuse Math.multiplyExact/addExact in the LCMSImageLayout class

Alexander Zvegintsev azvegint at openjdk.java.net
Wed Apr 7 21:51:41 UTC 2021


On Sun, 4 Apr 2021 07:58:44 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:

>> - The hand-crafted methods for addition and multiplication are replaced by the "Math" versions.
>> - Cleanup: the usage of do/while(false) is removed
>
> src/java.desktop/share/classes/sun/java2d/cmm/lcms/LCMSImageLayout.java line 241:
> 
>> 239:                         l.imageAtOnce = true;
>> 240:                     }
>> 241:                 } while (false);
> 
> Any idea why the "do/while(false)" was used here?

Probably it is just a way to highlight and improve readability of a block of code, but simply `{}` would be enough in this case.

-------------

PR: https://git.openjdk.java.net/jdk/pull/3333


More information about the 2d-dev mailing list