Inlining SDRenderType returns in QuartzRenderer.m

SWinxy swinxythecat at gmail.com
Tue Sep 6 18:49:32 UTC 2022


Hey y'all, I was looking at QuartzRenderer.m
<https://github.com/openjdk/jdk/blob/master/src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzRenderer.m>,
and noticed that a bunch of functions could directly return an SDRenderType
enum at the end, rather than returning a local variable set at the start
<https://github.com/openjdk/jdk/blob/master/src/java.desktop/macosx/native/libawt_lwawt/awt/QuartzRenderer.m#L173-L182>.
Can they be changed so that the logic to determine what is returned sits at
the end of the functions instead? E.g. `return fill ? SD_Fill : SD_Stroke`.
Way more concise!

Thoughts?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20220906/9deecf05/attachment.htm>


More information about the client-libs-dev mailing list