You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Creating a new complete instance every time you need an empty JsonObject or JsonArray is a waste of memory. (creating LinkedTreeMap and ArrayList with default size)
public static final JsonObject EMPTY public static final JsonArray EMPTY
They are immutable and always constant. So we don't even need to include any Map or List in them.
The text was updated successfully, but these errors were encountered:
I'm not sure about this. Do you see a lot of use for them? I'm a little concerned that JsonObject and JsonArray have always been mutable, and if we suddenly introduce immutable variants they may interact poorly with existing code.
Feature description
Creating a new complete instance every time you need an empty JsonObject or JsonArray is a waste of memory. (creating LinkedTreeMap and ArrayList with default size)
public static final JsonObject EMPTY
public static final JsonArray EMPTY
They are immutable and always constant. So we don't even need to include any Map or List in them.
The text was updated successfully, but these errors were encountered: