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

Some code that can be simplified #18342

Closed
wants to merge 2 commits into from

Conversation

Scott-YuYan
Copy link
Contributor

1.for loop can replaceable with foreach.
2. Anonymous type can be replaced with lambda.

1.```'for'```loop can replaceable with ```'foreach'```.
2.Anonymous type can be replaced with lambda.
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Sep 24, 2019
@philwebb philwebb added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged labels Sep 24, 2019
@philwebb philwebb added this to the 2.2.x milestone Sep 24, 2019
@@ -65,8 +65,8 @@ public JSONArray() {
public JSONArray(Collection copyFrom) {
this();
if (copyFrom != null) {
for (Iterator it = copyFrom.iterator(); it.hasNext();) {
put(JSONObject.wrap(it.next()));
for (Object it : copyFrom) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When merging, I think we should leave this as-is so that it matches the original source.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, thank you for your letter.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it matches the original source

@wilkinsona I'm sorry but I don't quite understand, what's the difference of these two versions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no functional difference, but the source code is different. This code is a copy of code authored elsewhere and we don't want to diverge from its original form.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for clarification! :)

@wilkinsona wilkinsona added the for: merge-with-amendments Needs some changes when we merge label Sep 24, 2019
philwebb pushed a commit that referenced this pull request Sep 27, 2019
philwebb added a commit that referenced this pull request Sep 27, 2019
@philwebb philwebb closed this in 78996b1 Sep 27, 2019
@pivotal-issuemaster
Copy link

@Scott-YuYan Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@philwebb
Copy link
Member

Thanks @Scott-YuYan for your first contribution to Spring Boot. This has now been merged to master with the change Andy suggested.

@philwebb philwebb modified the milestones: 2.2.x, 2.2.0.RC1 Sep 27, 2019
@Scott-YuYan
Copy link
Contributor Author

Scott-YuYan commented Sep 27, 2019 via email

@philwebb
Copy link
Member

@Scott-YuYan I've already taken care of it. There's nothing needed on your side. Thanks again!

@Scott-YuYan
Copy link
Contributor Author

Scott-YuYan commented Sep 27, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: merge-with-amendments Needs some changes when we merge type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants