On Thu, 16 Feb 2023 14:19:12 GMT, Maurizio Cimadamore <mcimadam...@openjdk.org> 
wrote:

>> Adam Sotona has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   added 4-byte Unicode text to Utf8EntryTest
>
> src/java.base/share/classes/jdk/internal/classfile/impl/ChainedFieldBuilder.java
>  line 48:
> 
>> 46:         this.consumer = consumer;
>> 47:         FieldBuilder b = downstream;
>> 48:         while (b instanceof ChainedFieldBuilder cb)
> 
> I'm probably missing something - but if `b` is another chained builder, 
> instead of using a loop, can't we just skip to its  `terminal` field? Also, 
> the `downstream` field seems unused. (same considerations apply for 
> `ChainedMethodBuilder` and `ChainedClassBuilder`).
> 
> I note that `NonTerminalCodeBuilder` seems to be already doing what I suggest 
> here (e.g. skip to `terminal`).

I would have to test possible side-effects of the proposed shortcut to give you 
answer.
Thanks for pointing it out.

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

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

Reply via email to