Skip to content

Commit 5d03923

Browse files
mebigfatguyerh
authored andcommitted
remove the allocation and use of StringBuilders
1 parent 2caa363 commit 5d03923

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/main/com/mongodb/util/JSON.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ protected Object parseArray(String name) {
639639
int i = 0;
640640
char current = get();
641641
while( current != ']' ) {
642-
String elemName = "" + i++;
642+
String elemName = String.valueOf(i++);
643643
Object elem = parse(elemName);
644644
doCallback(elemName, elem);
645645

src/main/org/bson/types/BasicBSONList.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public Map toMap() {
141141
Iterator i = this.keySet().iterator();
142142
while (i.hasNext()) {
143143
Object s = i.next();
144-
m.put(s, this.get(s+""));
144+
m.put(s, this.get(String.valueOf(s)));
145145
}
146146
return m;
147147
}

0 commit comments

Comments
 (0)