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

Remove path part concatenation for paths without parameters and removed append and concatenation of single characters #4585

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

paulomorgado
Copy link
Contributor

@paulomorgado paulomorgado commented Nov 16, 2023

Improves on #4579.
Ddresses #4587.

Generated code is now:

// Operation Path: "sum/{a}/{b}"
urlBuilder_.Append("sum/");
urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(a, System.Globalization.CultureInfo.InvariantCulture)));
urlBuilder_.Append('/');
urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(b, System.Globalization.CultureInfo.InvariantCulture)));
// Operation Path: "abs({a})"
urlBuilder_.Append("abs(");
urlBuilder_.Append(System.Uri.EscapeDataString(ConvertToString(a, System.Globalization.CultureInfo.InvariantCulture)));
urlBuilder_.Append(')');

Also replaces appending a single character string with appending a character and replaces string concatenation to be appending with appending of the two strings.

@paulomorgado paulomorgado marked this pull request as draft November 17, 2023 08:46
… append and concatenation of single characteres
@cristipufu
Copy link
Contributor

@paulomorgado @RicoSuter @lahma can we please fast track this fix?

@paulomorgado paulomorgado marked this pull request as ready for review November 21, 2023 13:36
@RicoSuter RicoSuter merged commit de09331 into RicoSuter:master Nov 21, 2023
1 check passed
@RicoSuter
Copy link
Owner

Thanks for the PR.

@paulomorgado paulomorgado deleted the performance/url-builder branch November 21, 2023 17:39
lahma pushed a commit to lahma/NSwag that referenced this pull request Jan 20, 2024
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.

None yet

3 participants