X Tutup
Skip to content

Added clear() methods to JSONObject and JSONArray#577

Merged
stleary merged 4 commits intostleary:masterfrom
stranck:master
Dec 7, 2020
Merged

Added clear() methods to JSONObject and JSONArray#577
stleary merged 4 commits intostleary:masterfrom
stranck:master

Conversation

@stranck
Copy link
Copy Markdown
Contributor

@stranck stranck commented Dec 4, 2020

I noticed that there wasn't this easy way to clear all the childs of a JSONObject or a JSONArray, so I added it.
Changes in code are really simple

@stleary
Copy link
Copy Markdown
Owner

stleary commented Dec 4, 2020

@stranck Thanks for submitting this PR. The submitter is usually asked to provide a use case or justification, but I guess in this case it is self-evident. No objection to proceeding after you add the appropriate unit tests.

(I hope they works :c)
@stranck
Copy link
Copy Markdown
Contributor Author

stranck commented Dec 4, 2020

I should've added them :)
Tell me if they're alright and thank you for being so fast in replying ahahahhaha

@stleary
Copy link
Copy Markdown
Owner

stleary commented Dec 5, 2020

What problem does this code solve?
This is an enhancement to include a missed clear() method, not a bug fix. The API includes JSONObject and JSONArray methods that recognize they are containers, so adding this method makes sense.

Risks
Low

Changes to the API?
New public methods are added to JSONObject and JSONArray

Will this require a new release?
No

Should the documentation be updated?
No

Does it break the unit tests?
No, new unit tests were added

Was any code refactored in this commit?
No

Review status
APPROVED

@stleary
Copy link
Copy Markdown
Owner

stleary commented Dec 5, 2020

Starting 3-day comment window

This was referenced Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup