Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow config init size of jsonarray and jsonobject #81

Merged
merged 1 commit into from
Apr 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions json-smart/src/main/java/net/minidev/json/JSONArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@
public class JSONArray extends ArrayList<Object> implements List<Object>, JSONAwareEx, JSONStreamAwareEx {
private static final long serialVersionUID = 9106884089231309568L;

public JSONArray() {
}

public JSONArray(int initialCapacity) {
super(initialCapacity);
}

public static String toJSONString(List<? extends Object> list) {
return toJSONString(list, JSONValue.COMPRESSION);
}
Expand Down
4 changes: 4 additions & 0 deletions json-smart/src/main/java/net/minidev/json/JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ public JSONObject() {
super();
}

public JSONObject(int initialCapacity) {
super(initialCapacity);
}

/**
* Escape quotes, \, /, \r, \n, \b, \f, \t and other control characters
* (U+0000 through U+001F). It's the same as JSONValue.escape() only for
Expand Down