[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-serviceability-dev
Subject:    Integrated: 8274662: Replace 'while' cycles with iterator with enhanced-for in jdk.hotspot.agent
From:       Andrey Turbanov <duke () openjdk ! java ! net>
Date:       2021-11-16 11:21:40
Message-ID: 5blsSopNgFT4MEUxOOTTHp6MX73jzfUxOV0WTV-4dIw=.3793fdb3-3e6b-4dd1-8e5b-7e68bddb61f0 () github ! com
[Download RAW message or body]

On Wed, 22 Sep 2021 08:58:01 GMT, Andrey Turbanov <duke@openjdk.java.net> wrote:

> There are few places in code where manual `while` loop is used with Iterator to \
> iterate over Collection. Instead of manual `while` cycles it's preferred to use \
> _enhanced-for_ cycle instead: it's less verbose, makes code easier to read and it's \
> less error-prone. It doesn't have any performance impact: javac compiler generates \
> similar code when compiling enhanced-for cycle. 
> Similar cleanups:
> * https://bugs.openjdk.java.net/browse/JDK-8258006
> * https://bugs.openjdk.java.net/browse/JDK-8257912

This pull request has now been integrated.

Changeset: c06df25a
Author:    Andrey Turbanov <turbanoff@gmail.com>
Committer: Serguei Spitsyn <sspitsyn@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/c06df25a4fb76ee65d3fa99ec0579ca4a406c345
                
Stats:     16 lines in 2 files changed: 0 ins; 8 del; 8 mod

8274662: Replace 'while' cycles with iterator with enhanced-for in jdk.hotspot.agent

Reviewed-by: amenkov, cjplummer, sspitsyn

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

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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic