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

SWinxy duke at openjdk.org
Sun Sep 25 18:00:39 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 are still basically the same.
> 
> 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:

  Update copyright year

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

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

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

  Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 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