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

List:       openjdk-2d-dev
Subject:    [OpenJDK 2D-Dev] Integrated: 8258006: Replaces while cycles with iterator with enhanced for in java.
From:       Andrey Turbanov <github.com+741251+turbanoff () openjdk ! java ! net>
Date:       2020-12-19 22:22:56
Message-ID: uSJQqN9o0mF2ijG6OQRlBnejqVAMkwHGJcu26ZIiHDQ=.f4b7d9a5-a770-49bd-b8e3-5f219a21e4ff () github ! com
[Download RAW message or body]

On Wed, 2 Dec 2020 19:23:28 GMT, Andrey Turbanov \
<github.com+741251+turbanoff@openjdk.org> 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: java compiler generates \
> similar code when compiling _enhanced-for_ cycle. 
> See similar cleanup in C++ code - #1707

This pull request has now been integrated.

Changeset: 580af490
Author:    Andrey Turbanov <turbanoff@gmail.com>
Committer: Sergey Bylokhov <serb@openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/580af490
Stats:     167 lines in 25 files changed: 0 ins; 99 del; 68 mod

8258006: Replaces while cycles with iterator with enhanced for in java.desktop

Reviewed-by: prr, serb

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

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


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

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