On Tue, 24 Jan 2023 16:25:46 GMT, Sergey Bylokhov <s...@openjdk.org> wrote:

>> No need to fill elements of array with default values if it was just 
>> created. Java guarantees that all elements of numeric array have default 
>> values after allocations - 0.
>
> src/java.desktop/share/classes/java/awt/image/Raster.java line 372:
> 
>> 370:         for (int i = 0; i < bands; i++) {
>> 371:             bankIndices[i] = i;
>> 372:             bandOffsets[i] = 0;
> 
> I suggest to comment this line and adding a comment like "0 zero is the 
> default value not need to be set"

Yeah, please, no commented-out code. I'd be fine with the code as it was, I 
don't think it needs much clarification. If @mrserb insists on a comment then I 
agree that a comment on the array declaration should be sufficient.

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

PR: https://git.openjdk.org/jdk/pull/12147

Reply via email to