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

SWinxy duke at openjdk.org
Thu Sep 8 05:23:40 UTC 2022


> 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 still are equivalent.
> 
> Example change:
> 
> SDRenderType renderType = SD_Nothing;
> 
> if (fill == YES)
> {
>     renderType = SD_Fill;
> }
> else
> {
>     renderType = SD_Stroke;
> }
> 
> // ...
> 
> return renderType;
> 
> 
> 
> // ...
> 
> return fill ? SD_Fill : SD_Stroke;

SWinxy has updated the pull request incrementally with one additional commit since the last revision:

  We can do this here, too

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10174/files
  - new: https://git.openjdk.org/jdk/pull/10174/files/f83cbcdf..8fbaaa69

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10174&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10174&range=00-01

  Stats: 11 lines in 1 file changed: 0 ins; 10 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/10174.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10174/head:pull/10174

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



More information about the client-libs-dev mailing list