Remove unnecessary variable creations. (#882)
This commit is contained in:
parent
d5f43dce28
commit
ba08d40beb
|
@ -493,12 +493,11 @@ public class ExtendedMessageFormat extends MessageFormat {
|
|||
|
||||
final int start = pos.getIndex();
|
||||
final char[] c = pattern.toCharArray();
|
||||
final int lastHold = start;
|
||||
for (int i = pos.getIndex(); i < pattern.length(); i++) {
|
||||
if (c[pos.getIndex()] == QUOTE) {
|
||||
next(pos);
|
||||
return appendTo == null ? null : appendTo.append(c, lastHold,
|
||||
pos.getIndex() - lastHold);
|
||||
return appendTo == null ? null : appendTo.append(c, start,
|
||||
pos.getIndex() - start);
|
||||
}
|
||||
next(pos);
|
||||
}
|
||||
|
|
|
@ -205,9 +205,8 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
|
|||
} else if (length > size) {
|
||||
ensureCapacity(length);
|
||||
final int oldEnd = size;
|
||||
final int newEnd = length;
|
||||
size = length;
|
||||
for (int i = oldEnd; i < newEnd; i++) {
|
||||
for (int i = oldEnd; i < length; i++) {
|
||||
buffer[i] = CharUtils.NUL;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue