RFR: 8293478: [java.desktop/macOS] Condense SDRenderType usages in QuartzRenderer.m [v3]

SWinxy duke at openjdk.org
Sun Jan 15 04:05:12 UTC 2023


On Sun, 25 Sep 2022 18:00:39 GMT, SWinxy <duke at openjdk.org> wrote:

>> The `SDRenderType` enum is often returned using a variable declared at the start of functions. These can be inlined in the `return` itself. Using a ternary operator condenses what may be 12 lines into one, in the most extreme cases. `doRectUsingCG` and `doPolyUsingCG` were both modified more than the rest, but are still basically the same.
>> 
>> Example change:
>> 
>> SDRenderType renderType = SD_Nothing;
>> 
>> if (fill == YES)
>> {
>>     renderType = SD_Fill;
>> }
>> else
>> {
>>     renderType = SD_Stroke;
>> }
>> 
>> // draw logic
>> 
>> return renderType;
>> 
>> 
>> 
>> // draw logic
>> 
>> return fill ? SD_Fill : SD_Stroke;
>
> SWinxy has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Update copyright year

Bumping for the bot.

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

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



More information about the client-libs-dev mailing list