-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Some code that can be simplified #18342
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
Conversation
1.```'for'```loop can replaceable with ```'foreach'```. 2.Anonymous type can be replaced with lambda.
@@ -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) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks for clarification! :)
@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. |
Thanks @Scott-YuYan for your first contribution to Spring Boot. This has now been merged to master with the change Andy suggested. |
Ok,i'll do it.
…---Original---
From: "Phil Webb"<[email protected]>
Date: Fri, Sep 27, 2019 10:16 AM
To: "spring-projects/spring-boot"<[email protected]>;
Cc: "Mention"<[email protected]>;"Scott_Yu"<[email protected]>;
Subject: Re: [spring-projects/spring-boot] Some code that can be simplified (#18342)
Thanks @Scott-YuYan for your first contribution to Spring Boot. This has now been merged to master with the change Andy suggested.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@Scott-YuYan I've already taken care of it. There's nothing needed on your side. Thanks again! |
Thanks you,sorry for disturbance.
…---Original---
From: "Phil Webb"<[email protected]>
Date: Fri, Sep 27, 2019 12:43 PM
To: "spring-projects/spring-boot"<[email protected]>;
Cc: "Mention"<[email protected]>;"Scott_Yu"<[email protected]>;
Subject: Re: [spring-projects/spring-boot] Some code that can be simplified (#18342)
@Scott-YuYan I've already taken care of it. There's nothing needed on your side. Thanks again!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
1.
for
loop can replaceable withforeach
.2. Anonymous type can be replaced with lambda.