[Swift-commit] r7536 - in trunk/src/org/griphyn/vdl: engine karajan/lib
hategan at ci.uchicago.edu
hategan at ci.uchicago.edu
Thu Jan 30 21:40:28 CST 2014
Author: hategan
Date: 2014-01-30 21:40:28 -0600 (Thu, 30 Jan 2014)
New Revision: 7536
Modified:
trunk/src/org/griphyn/vdl/engine/Karajan.java
trunk/src/org/griphyn/vdl/karajan/lib/Range.java
trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java
Log:
use Integer.valueOf instead of new Integer since it caches commonly used values
Modified: trunk/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/Karajan.java 2014-01-31 03:38:40 UTC (rev 7535)
+++ trunk/src/org/griphyn/vdl/engine/Karajan.java 2014-01-31 03:40:28 UTC (rev 7536)
@@ -1397,7 +1397,7 @@
} else if (expressionQName.equals(INT_EXPR)) {
XmlInt xmlInt = (XmlInt) expression;
int i = xmlInt.getIntValue();
- Integer iobj = new Integer(i);
+ Integer iobj = Integer.valueOf(i);
String internedID;
if(intInternMap.get(iobj) == null) {
internedID = "swift#int#" + i;
Modified: trunk/src/org/griphyn/vdl/karajan/lib/Range.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/Range.java 2014-01-31 03:38:40 UTC (rev 7535)
+++ trunk/src/org/griphyn/vdl/karajan/lib/Range.java 2014-01-31 03:40:28 UTC (rev 7536)
@@ -113,10 +113,10 @@
{
if (type == Types.INT) {
- value = new RootDataNode(Types.INT, new Integer((int) crt));
+ value = new RootDataNode(Types.INT, (int) crt);
}
else {
- value = new RootDataNode(Types.FLOAT, new Double(crt));
+ value = new RootDataNode(Types.FLOAT, Double.valueOf(crt));
}
key = index;
}
Modified: trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java
===================================================================
--- trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java 2014-01-31 03:38:40 UTC (rev 7535)
+++ trunk/src/org/griphyn/vdl/karajan/lib/SwiftFunction.java 2014-01-31 03:40:28 UTC (rev 7536)
@@ -147,10 +147,10 @@
protected Object internalValue(Type type, Object value) {
if (Types.FLOAT.equals(type)) {
- return new Double(TypeUtil.toDouble(value));
+ return Double.valueOf(TypeUtil.toDouble(value));
}
else if (Types.INT.equals(type)) {
- return new Integer(TypeUtil.toInt(value));
+ return Integer.valueOf(TypeUtil.toInt(value));
}
else if (Types.BOOLEAN.equals(type)) {
return new Boolean(TypeUtil.toBoolean(value));
More information about the Swift-commit
mailing list