mirror of
https://github.com/processing/processing4.git
synced 2026-05-03 17:35:00 +02:00
Optimize creation of boxed primitives
This commit is contained in:
@@ -493,7 +493,7 @@ public class FloatDict {
|
||||
keys = PApplet.expand(keys);
|
||||
values = PApplet.expand(values);
|
||||
}
|
||||
indices.put(what, new Integer(count));
|
||||
indices.put(what, Integer.valueOf(count));
|
||||
keys[count] = what;
|
||||
values[count] = much;
|
||||
count++;
|
||||
@@ -540,8 +540,8 @@ public class FloatDict {
|
||||
keys[b] = tkey;
|
||||
values[b] = tvalue;
|
||||
|
||||
indices.put(keys[a], new Integer(a));
|
||||
indices.put(keys[b], new Integer(b));
|
||||
indices.put(keys[a], Integer.valueOf(a));
|
||||
indices.put(keys[b], Integer.valueOf(b));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -486,7 +486,7 @@ public class IntDict {
|
||||
keys = PApplet.expand(keys);
|
||||
values = PApplet.expand(values);
|
||||
}
|
||||
indices.put(what, new Integer(count));
|
||||
indices.put(what, Integer.valueOf(count));
|
||||
keys[count] = what;
|
||||
values[count] = much;
|
||||
count++;
|
||||
@@ -532,8 +532,8 @@ public class IntDict {
|
||||
keys[b] = tkey;
|
||||
values[b] = tvalue;
|
||||
|
||||
indices.put(keys[a], new Integer(a));
|
||||
indices.put(keys[b], new Integer(b));
|
||||
indices.put(keys[a], Integer.valueOf(a));
|
||||
indices.put(keys[b], Integer.valueOf(b));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ public class JSONArray {
|
||||
public JSONArray(IntList list) {
|
||||
myArrayList = new ArrayList<Object>();
|
||||
for (int item : list.values()) {
|
||||
myArrayList.add(new Integer(item));
|
||||
myArrayList.add(Integer.valueOf(item));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -718,7 +718,7 @@ public class JSONArray {
|
||||
* @return this.
|
||||
*/
|
||||
public JSONArray append(int value) {
|
||||
this.append(new Integer(value));
|
||||
this.append(Integer.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ public class JSONArray {
|
||||
* @return this.
|
||||
*/
|
||||
public JSONArray append(long value) {
|
||||
this.append(new Long(value));
|
||||
this.append(Long.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -758,7 +758,7 @@ public class JSONArray {
|
||||
* @return this.
|
||||
*/
|
||||
public JSONArray append(double value) {
|
||||
Double d = new Double(value);
|
||||
Double d = value;
|
||||
JSONObject.testValidity(d);
|
||||
this.append(d);
|
||||
return this;
|
||||
@@ -884,7 +884,7 @@ public class JSONArray {
|
||||
* @see JSONArray#setBoolean(int, boolean)
|
||||
*/
|
||||
public JSONArray setInt(int index, int value) {
|
||||
this.set(index, new Integer(value));
|
||||
this.set(index, Integer.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -899,7 +899,7 @@ public class JSONArray {
|
||||
* @throws JSONException If the index is negative.
|
||||
*/
|
||||
public JSONArray setLong(int index, long value) {
|
||||
return set(index, new Long(value));
|
||||
return set(index, Long.valueOf(value));
|
||||
}
|
||||
|
||||
|
||||
@@ -936,7 +936,7 @@ public class JSONArray {
|
||||
* not finite.
|
||||
*/
|
||||
public JSONArray setDouble(int index, double value) {
|
||||
return set(index, new Double(value));
|
||||
return set(index, Double.valueOf(value));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1168,7 +1168,7 @@ public class JSONObject {
|
||||
* @see JSONObject#setBoolean(String, boolean)
|
||||
*/
|
||||
public JSONObject setInt(String key, int value) {
|
||||
this.put(key, new Integer(value));
|
||||
this.put(key, Integer.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1182,7 +1182,7 @@ public class JSONObject {
|
||||
* @throws JSONException If the key is null.
|
||||
*/
|
||||
public JSONObject setLong(String key, long value) {
|
||||
this.put(key, new Long(value));
|
||||
this.put(key, Long.valueOf(value));
|
||||
return this;
|
||||
}
|
||||
|
||||
@@ -1494,7 +1494,7 @@ public class JSONObject {
|
||||
} else {
|
||||
Long myLong = new Long(string);
|
||||
if (myLong.longValue() == myLong.intValue()) {
|
||||
return new Integer(myLong.intValue());
|
||||
return Integer.valueOf(myLong.intValue());
|
||||
} else {
|
||||
return myLong;
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ public class StringDict {
|
||||
keys = PApplet.expand(keys);
|
||||
values = PApplet.expand(values);
|
||||
}
|
||||
indices.put(key, new Integer(count));
|
||||
indices.put(key, Integer.valueOf(count));
|
||||
keys[count] = key;
|
||||
values[count] = value;
|
||||
count++;
|
||||
@@ -325,8 +325,8 @@ public class StringDict {
|
||||
keys[b] = tkey;
|
||||
values[b] = tvalue;
|
||||
|
||||
indices.put(keys[a], new Integer(a));
|
||||
indices.put(keys[b], new Integer(b));
|
||||
indices.put(keys[a], Integer.valueOf(a));
|
||||
indices.put(keys[b], Integer.valueOf(b));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user