RFR: 8300237: Minor improvements in MethodHandles

Claes Redestad redestad at openjdk.org
Tue Jan 17 10:07:13 UTC 2023


On Tue, 17 Jan 2023 08:22:28 GMT, Sergey Tsypanov <stsypanov at openjdk.org> wrote:

> - `MethodType.ptypes()` can be used instead of `MethodType.parameterList()` when we don't need a copy
> - comparison of two lists can be done without `Stream.reduce()`

Remove `EMPTY` (using my earlier suggestion or by simply inlining `new Class<?>[0]`) and I think this looks OK if framed as a code cleanup. The affected code isn't very performance sensitive as it's only used in the setup for `MHs.loop` combinators, which are likely to be rare in practice.

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

Changes requested by redestad (Reviewer).

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


More information about the core-libs-dev mailing list