Apply fixes for EfficientStrings.

Refactoring to avoid StringBuffer synchronization overhead.

Bug: 170978902
Test: none
Exempt-From-Owner-Approval: trivial refactoring
Change-Id: Ibf843ed780c1202d5d96a11eaca889e592f19263
This commit is contained in:
Jeff Sharkey
2020-10-17 21:20:13 -06:00
parent f18719bb73
commit c603ca2dd8
17 changed files with 24 additions and 24 deletions

View File

@@ -648,7 +648,7 @@ public final class EncodedBuffer {
* Print the internal buffer chunks.
*/
private static int dumpByteString(String tag, String prefix, int start, byte[] buf) {
StringBuffer sb = new StringBuffer();
StringBuilder sb = new StringBuilder();
final int length = buf.length;
final int lineLen = 16;
int i;
@@ -656,7 +656,7 @@ public final class EncodedBuffer {
if (i % lineLen == 0) {
if (i != 0) {
Log.d(tag, sb.toString());
sb = new StringBuffer();
sb = new StringBuilder();
}
sb.append(prefix);
sb.append('[');