Skip to content

Commit

Permalink
optimization: use valueOf instead of constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Dec 17, 2017
1 parent 6251669 commit 8447fda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ public synchronized void write(int data) throws IOException { // expected diff w
} else if (data == SECOND_OSC_CHAR) {
state = LOOKING_FOR_OSC_COMMAND;
} else if (data == SECOND_CHARSET0_CHAR) {
options.add(new Integer('0'));
options.add(Integer.valueOf(0));
state = LOOKING_FOR_CHARSET;
} else if (data == SECOND_CHARSET1_CHAR) {
options.add(new Integer('1'));
options.add(Integer.valueOf(1));
state = LOOKING_FOR_CHARSET;
} else {
reset(false);
Expand Down Expand Up @@ -205,7 +205,7 @@ public synchronized void write(int data) throws IOException { // expected diff w
break;

case LOOKING_FOR_CHARSET:
options.add(new Character((char) data));
options.add(Character.valueOf((char) data));
reset(processCharsetSelect(options));
break;
}
Expand Down
6 changes: 3 additions & 3 deletions jansi/src/main/java/org/fusesource/jansi/AnsiPrintStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ protected boolean filter(int data) { // expected diff with AnsiOutputStream.java
} else if (data == SECOND_OSC_CHAR) {
state = LOOKING_FOR_OSC_COMMAND;
} else if (data == SECOND_CHARSET0_CHAR) {
options.add(new Integer('0'));
options.add(Integer.valueOf(0));
state = LOOKING_FOR_CHARSET;
} else if (data == SECOND_CHARSET1_CHAR) {
options.add(new Integer('1'));
options.add(Integer.valueOf(1));
state = LOOKING_FOR_CHARSET;
} else {
reset(false);
Expand Down Expand Up @@ -200,7 +200,7 @@ protected boolean filter(int data) { // expected diff with AnsiOutputStream.java
break;

case LOOKING_FOR_CHARSET:
options.add(new Character((char) data));
options.add(Character.valueOf((char) data));
reset(processCharsetSelect(options));
break;
}
Expand Down

0 comments on commit 8447fda

Please sign in to comment.