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 2018/04/04 00:20:31 UTC

[2/6] groovy git commit: Avoid redundant array creation

Avoid redundant array creation

(cherry picked from commit 6d0e2f6)


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

Branch: refs/heads/GROOVY_2_5_X
Commit: d9aa0110b6b7cbd6ad3e22ee0d26cd647ac49381
Parents: b557020
Author: sunlan <su...@apache.org>
Authored: Wed Apr 4 08:07:34 2018 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Apr 4 08:20:25 2018 +0800

----------------------------------------------------------------------
 .../groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java    | 2 +-
 .../groovy-swing/src/main/java/groovy/model/ClosureModel.java      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/groovy/blob/d9aa0110/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java b/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
index 59d9c7d..c8b67f7 100644
--- a/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
+++ b/subprojects/groovy-sql/src/main/java/groovy/sql/ExtractIndexAndSql.java
@@ -197,7 +197,7 @@ class ExtractIndexAndSql {
             int index = (indexStr == null || indexStr.length() == 0 || ":".equals(indexStr)) ? 0 : Integer.parseInt(indexStr) - 1;
             String prop = matcher.group(2);
             if (prop == null) prop = matcher.group(4);
-            indexPropList.add(new Tuple(new Object[]{index, prop == null || prop.length() == 0 ? "<this>" : prop}));
+            indexPropList.add(new Tuple(index, prop == null || prop.length() == 0 ? "<this>" : prop));
             txtIndex = matcher.end();
         }
         newSql.append(sql.substring(txtIndex)); // append ending SQL after last param.

http://git-wip-us.apache.org/repos/asf/groovy/blob/d9aa0110/subprojects/groovy-swing/src/main/java/groovy/model/ClosureModel.java
----------------------------------------------------------------------
diff --git a/subprojects/groovy-swing/src/main/java/groovy/model/ClosureModel.java b/subprojects/groovy-swing/src/main/java/groovy/model/ClosureModel.java
index d25c6e7..82c1471 100644
--- a/subprojects/groovy-swing/src/main/java/groovy/model/ClosureModel.java
+++ b/subprojects/groovy-swing/src/main/java/groovy/model/ClosureModel.java
@@ -65,7 +65,7 @@ public class ClosureModel implements ValueModel, NestedValueModel {
         if (writeClosure != null) {
             Object source = sourceModel.getValue();
             if (source != null) {
-                writeClosure.call(new Object[] { source, value });
+                writeClosure.call(source, value);
             }
         }
     }