On Tue, 22 Nov 2022 22:33:49 GMT, Kevin Rushforth <k...@openjdk.org> wrote:

>> (long) width * height * 4;
>> is dangerous if one does not remember the precedence rules - is typecast 
>> applied to width or the end result?
>> 4L * w * h; is unambiguous.
>
> I'm not sure I like either of the two choices you listed. By "revert it back" 
> I mean leave the code alone. The existing code, with its explicit casts, 
> leaves no room for doubt:
> 
> 
> return ((long) width) * ((long) height) * 4L;

`4L * w * h;` seems rather clear to me, definitely more than explicitly casting 
every argument. I assume each person is used to seeing specific patterns and 
that influences what is easier for them to read.

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

PR: https://git.openjdk.org/jfx/pull/960

Reply via email to