1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

* Updates array constructor and bulk operations to best guess capacity information

* Update JSONObject to allow best guess for initial capacity.
This commit is contained in:
John J. Aylward 2017-06-08 11:22:23 -04:00
parent ef7a5e40be
commit 9c092753b0
3 changed files with 25 additions and 7 deletions

View file

@ -41,7 +41,7 @@ public class Property {
* @throws JSONException
*/
public static JSONObject toJSONObject(java.util.Properties properties) throws JSONException {
JSONObject jo = new JSONObject();
JSONObject jo = new JSONObject(properties == null ? 0 : properties.size());
if (properties != null && !properties.isEmpty()) {
Enumeration<?> enumProperties = properties.propertyNames();
while(enumProperties.hasMoreElements()) {