Remove unnecessary variable creations. (#882)

This commit is contained in:
Arturo Bernal 2022-05-02 15:33:50 +02:00 committed by GitHub
parent d5f43dce28
commit ba08d40beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -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);
}

View File

@ -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;
}
}