Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit db28ed58 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

Increase initial StringBuffer capacity in View.toString.

128 was probably a reasonable number back when class names were shorter,
and we only had one flags field, and there were no kids on my lawn.
But modern views often exceed 128 bytes when stringified, resulting in
another allocation and array copy.

256 ought to be enough for anybody.

Change-Id: Ib7d4bc4948eb36f42b0e0d35f672398b3bbcea33
Test: atest, presubmit
Fixes: 189276070
parent d0208e16
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -6431,7 +6431,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
    @Override
    public String toString() {
        StringBuilder out = new StringBuilder(128);
        StringBuilder out = new StringBuilder(256);
        out.append(getClass().getName());
        out.append('{');
        out.append(Integer.toHexString(System.identityHashCode(this)));