You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by su...@apache.org on 2020/06/15 23:49:34 UTC

[groovy] branch GROOVY_3_0_X updated: Trivial refactoring: Avoid redundant calls

This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/GROOVY_3_0_X by this push:
     new 3311aab  Trivial refactoring: Avoid redundant calls
3311aab is described below

commit 3311aab645a02eba125bdd7a877b5a2c9630e50a
Author: Daniel Sun <su...@apache.org>
AuthorDate: Tue Jun 16 07:48:41 2020 +0800

    Trivial refactoring: Avoid redundant calls
    
    (cherry picked from commit c30cfda4302636a3e16e9ff94cc91f70be3e3994)
---
 src/main/java/org/codehaus/groovy/control/CompilationUnit.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
index a4d2019..b24440e 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilationUnit.java
@@ -898,8 +898,8 @@ public class CompilationUnit extends ProcessingUnit {
          */
         @Override
         default void doPhaseOperation(final CompilationUnit unit) throws CompilationFailedException {
-            for (String name : unit.sources.keySet()) {
-                SourceUnit source = unit.sources.get(name);
+            for (Map.Entry<String, SourceUnit> entry : unit.sources.entrySet()) {
+                SourceUnit source = entry.getValue();
                 if (source.phase < unit.phase || (source.phase == unit.phase && !source.phaseComplete)) {
                     try {
                         this.call(source);