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

Commit 69e2eff2 authored by Kenny Root's avatar Kenny Root
Browse files

Don't waste memory creating new Boolean objects

Creating a new Boolean is wasteful since there's already a static
Boolean.TRUE and Boolean.FALSE. Using Boolean.valueOf will return one of
those static objects and reduce memory usage a bit.

Change-Id: Id497f951c8a894ec03ac6c3181e6055b56db9db4
parent 1bf397ff
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -146,7 +146,7 @@ public final class GeolocationPermissions {
                            boolean allowed = nativeGetAllowed(origin);
                            Map retValues = new HashMap<String, Object>();
                            retValues.put(CALLBACK, callback);
                            retValues.put(ALLOWED, new Boolean(allowed));
                            retValues.put(ALLOWED, Boolean.valueOf(allowed));
                            postUIMessage(Message.obtain(null, RETURN_ALLOWED, retValues));
                            } break;
                        case CLEAR:
+1 −1
Original line number Diff line number Diff line
@@ -2054,7 +2054,7 @@ final class WebViewCore {
        }
        if (mWebView != null) {
            Message msg = Message.obtain(mWebView.mPrivateHandler,
                    WebView.SCROLL_BY_MSG_ID, dx, dy, new Boolean(animate));
                    WebView.SCROLL_BY_MSG_ID, dx, dy, Boolean.valueOf(animate));
            if (mDrawIsScheduled) {
                mEventHub.sendMessage(Message.obtain(null,
                        EventHub.MESSAGE_RELAY, msg));