RFR: 8258075: Use auto variable declarations for enum iteration [v2]

Ioi Lam iklam at openjdk.java.net
Wed Dec 16 19:43:14 UTC 2020


> The pattern used in https://github.com/openjdk/jdk/pull/1707
> 
> for (vmIntrinsicID index : EnumRange<vmIntrinsicID>{}) {
>   nt[as_int(index)] = string;
> }
> 
> can be further simplified to the following without loss of readability, since the type of `index` would obviously be the type enclosed by `EnumRange<>`
> 
> for (auto index : EnumRange<vmIntrinsicID>{}) {
>   nt[as_int(index)] = string;
> }
> 
> (as suggested by John Rose)

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains two additional commits since the last revision:

 - Merge branch 'master' into 8258075-auto-declaration-enum-iter
 - 8258075: Use auto variable declarations for enum iteration

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

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/1751/files
  - new: https://git.openjdk.java.net/jdk/pull/1751/files/7097f13b..71c31a84

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=1751&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=1751&range=00-01

  Stats: 7462 lines in 211 files changed: 4911 ins; 1914 del; 637 mod
  Patch: https://git.openjdk.java.net/jdk/pull/1751.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/1751/head:pull/1751

PR: https://git.openjdk.java.net/jdk/pull/1751


More information about the hotspot-dev mailing list