On Mon, 25 Mar 2024 05:56:52 GMT, Julian Waters <[email protected]> wrote:
> The only thing I'm uncertain about is the pData local, which I don't see much
> benefit in removing since the null check associated with it still has to
> remain for code semantics to be correct
The point is that you can do the null check on the correct variable directly,
instead of going a detour with pData. So instead of:
RealType realVal;
void* pData = getVal()
if (pData == null) {
// bail out
}
realVal = (RealType) pData;
you can just do:
RealType realVal = getVal();
if (realVal == null) {
// bail out
}
as the code normally would have been written, had there not been an old macro
that used the "magic" temporary pData variable.
This is a recurring pattern in this patch and needs to be fixed everywhere.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/15096#issuecomment-2017510861