On Sat, 25 Mar 2023 07:09:43 GMT, Rémi Forax <fo...@openjdk.org> wrote:

>> Stuart Marks has updated the pull request incrementally with two additional 
>> commits since the last revision:
>> 
>>  - More specification tweaks.
>>  - Add simple overrides to ArrayList.
>
> src/java.base/share/classes/java/util/ArrayList.java line 573:
> 
>> 571:         } else {
>> 572:             Object[] es = elementData;
>> 573:             sz--;
> 
> This line and the following two lines can be understood as the field size 
> being updated which is not the case.
> I think it's more readable to use
> 
> @SuppressWarnings("unchecked") E oldValue = (E) es[sz - 1];
> fastRemove(es, sz - 1);
> 
> The JIT will common the subexpression 'sz - 1' at runtime.

Renamed the variable.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/7387#discussion_r1167366493

Reply via email to