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

[C#] Fixed ArgumentOutOfRangeException. Optimized string concatenation. #1718

Merged
merged 1 commit into from
Dec 15, 2015
Merged

[C#] Fixed ArgumentOutOfRangeException. Optimized string concatenation. #1718

merged 1 commit into from
Dec 15, 2015

Conversation

artem-dudarev
Copy link
Contributor

If the list is empty you get the ArgumentOutOfRangeException when calling flattenString.Remove(flattenString.Length - 1) because it tries to remove a separator from the empty string.
Also using a StringBuilder is the prefered way to concatenate strings in a loop.

If the list is empty you get the ArgumentOutOfRangeException when calling flattenString.Remove(flattenString.Length - 1).
Also using a StringBuilder is the prefered way to concatenate strings in a loop.
@artem-dudarev artem-dudarev changed the title Fixed ArgumentOutOfRangeException. Optimized string concatenation. [C#] Fixed ArgumentOutOfRangeException. Optimized string concatenation. Dec 15, 2015
@wing328
Copy link
Contributor

wing328 commented Dec 15, 2015

@artem-dudarev thanks for the PR. The change looks good to me.

Will merge it shortly.

@wing328 wing328 added this to the v2.1.5 milestone Dec 15, 2015
wing328 added a commit that referenced this pull request Dec 15, 2015
[C#] Fixed ArgumentOutOfRangeException. Optimized string concatenation.
@wing328 wing328 merged commit adf7ffb into swagger-api:master Dec 15, 2015
@artem-dudarev artem-dudarev deleted the patch-1 branch December 15, 2015 11:13
@wing328
Copy link
Contributor

wing328 commented Dec 15, 2015

Next time please update the Petstore sample as mentioned in https://github.com/swagger-api/swagger-codegen/blob/master/CONTRIBUTING.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants