Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image [v2]

2023-02-02 Thread Alexey Ivanov
On Thu, 26 Jan 2023 09:28:48 GMT, Andrey Turbanov 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. > > Andrey Turbanov has updated the pull request incremen

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image [v2]

2023-02-02 Thread Sergey Bylokhov
On Thu, 26 Jan 2023 09:28:48 GMT, Andrey Turbanov 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. > > Andrey Turbanov has updated the pull request incremen

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image [v2]

2023-01-26 Thread SWinxy
On Thu, 26 Jan 2023 09:24:25 GMT, Andrey Turbanov wrote: >> That is not about the default values in the array but about missing >> initialization of `bandOffsets`, which we will skip intentionally. So it >> won't raise the question later why we initiated the Indices and not offsets. > > I've ad

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image [v2]

2023-01-26 Thread Attila Szegedi
On Thu, 26 Jan 2023 09:28:48 GMT, Andrey Turbanov 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. > > Andrey Turbanov has updated the pull request incremen

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image [v2]

2023-01-26 Thread Andrey Turbanov
On Tue, 24 Jan 2023 22:50:31 GMT, Sergey Bylokhov wrote: >> 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. > > T

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image [v2]

2023-01-26 Thread Andrey Turbanov
> 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. Andrey Turbanov has updated the pull request incrementally with one additional commit since the last revision: 830

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-24 Thread Sergey Bylokhov
On Tue, 24 Jan 2023 19:39:38 GMT, Attila Szegedi wrote: >> 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

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-24 Thread Attila Szegedi
On Tue, 24 Jan 2023 16:25:46 GMT, Sergey Bylokhov 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.

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-24 Thread Andrey Turbanov
On Tue, 24 Jan 2023 16:25:46 GMT, Sergey Bylokhov 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.

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-24 Thread Andrey Turbanov
On Tue, 24 Jan 2023 16:22:43 GMT, Sergey Bylokhov 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/Compone

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-24 Thread Sergey Bylokhov
On Mon, 23 Jan 2023 17:20:41 GMT, Andrey Turbanov 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/ComponentColo

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-24 Thread Attila Szegedi
On Mon, 23 Jan 2023 17:20:41 GMT, Andrey Turbanov 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. Marked as reviewed by attila (Reviewer). - PR

Re: RFR: 8300929: Avoid unnecessary array fill after creation in java.awt.image

2023-01-23 Thread SWinxy
On Mon, 23 Jan 2023 17:20:41 GMT, Andrey Turbanov 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. Marked as reviewed by swi...@github.com (no known OpenJDK u