RFR: 8258075: Use auto variable declarations for enum iteration
Calvin Cheung
ccheung at openjdk.java.net
Sat Dec 12 00:07:54 UTC 2020
On Fri, 11 Dec 2020 22:33:33 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> 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)
Looks good.
-------------
Marked as reviewed by ccheung (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/1751
More information about the hotspot-dev
mailing list