[foreign-memaccess+abi] RFR: Micro optimizations and tidy

Per Minborg duke at openjdk.org
Fri Aug 19 08:22:06 UTC 2022


On Thu, 18 Aug 2022 15:27:08 GMT, Paul Sandoz <psandoz at openjdk.org> wrote:

>> This small PR adds some optimizations and tidies up some imports.
>
> src/java.base/share/classes/java/lang/foreign/FunctionDescriptor.java line 83:
> 
>> 81:     public static FunctionDescriptor of(MemoryLayout resLayout, MemoryLayout... argLayouts) {
>> 82:         Objects.requireNonNull(resLayout);
>> 83:         assertVarargsNonNull(argLayouts);
> 
> This check is redundant, since it is performed by `List.of` (granted that the stack trace is different but i think that is ok for NPEs).

Well spotted!

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

PR: https://git.openjdk.org/panama-foreign/pull/708


More information about the panama-dev mailing list