groovy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pa...@apache.org
Subject groovy git commit: minor refactor - no need to loop through array when we have a set of names now
Date Mon, 14 May 2018 11:59:14 GMT
Repository: groovy
Updated Branches:
  refs/heads/GROOVY_2_6_X adfc7e394 -> eda1f82b9


minor refactor - no need to loop through array when we have a set of names now


Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/eda1f82b
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/eda1f82b
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/eda1f82b

Branch: refs/heads/GROOVY_2_6_X
Commit: eda1f82b958cb4840c4749f987935f2e2b4bef05
Parents: adfc7e3
Author: Daniel Sun <realbluesun@hotmail.com>
Authored: Mon May 14 21:56:22 2018 +1000
Committer: Paul King <paulk@asert.com.au>
Committed: Mon May 14 21:59:03 2018 +1000

----------------------------------------------------------------------
 .../org/codehaus/groovy/control/CompilerConfiguration.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/eda1f82b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
index 6fa0961..559a974 100644
--- a/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
+++ b/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
@@ -763,10 +763,8 @@ public class CompilerConfiguration {
      * @param version the bytecode compatibility level
      */
     public void setTargetBytecode(String version) {
-        for (String allowedJdk : ALLOWED_JDKS) {
-            if (allowedJdk.equals(version)) {
-                this.targetBytecode = version;
-            }
+        if (JDK_TO_BYTECODE_VERSION_MAP.keySet().contains(version)) {
+            this.targetBytecode = version;
         }
     }
 


Mime
View raw message