Integrated: 8258075: Use auto variable declarations for enum iteration

Ioi Lam iklam at openjdk.java.net
Wed Dec 16 19:43:17 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)

This pull request has now been integrated.

Changeset: 59f4c4aa
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/59f4c4aa
Stats:     16 lines in 6 files changed: 0 ins; 0 del; 16 mod

8258075: Use auto variable declarations for enum iteration

Reviewed-by: jrose, ccheung

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

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


More information about the hotspot-dev mailing list