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:12:07 UTC
[5/7] groovy git commit: Avoid redundant array creation
Avoid redundant array creation
Project: http://git-wip-us.apache.org/repos/asf/groovy/repo
Commit: http://git-wip-us.apache.org/repos/asf/groovy/commit/6d0e2f65
Tree: http://git-wip-us.apache.org/repos/asf/groovy/tree/6d0e2f65
Diff: http://git-wip-us.apache.org/repos/asf/groovy/diff/6d0e2f65
Branch: refs/heads/master
Commit: 6d0e2f657528a1b012533a3f7282fa7bd1446179
Parents: b07369a
Author: sunlan <su...@apache.org>
Authored: Wed Apr 4 08:07:34 2018 +0800
Committer: sunlan <su...@apache.org>
Committed: Wed Apr 4 08:07:34 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/6d0e2f65/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/6d0e2f65/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);
}
}
}