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:48:57 UTC

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

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

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


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

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

    Trivial refactoring: Avoid redundant calls
---
 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);