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

Convert concatenation string to interpolation for System.Private.Xml #60057

Merged

Conversation

kronic
Copy link
Contributor

@kronic kronic commented Oct 6, 2021

No description provided.

@ghost ghost added the community-contribution Indicates that the PR has been added by a community member label Oct 6, 2021
@ghost
Copy link

ghost commented Oct 6, 2021

Tagging subscribers to this area: @dotnet/area-system-xml
See info in area-owners.md if you want to be subscribed.

Issue Details

null

Author: kronic
Assignees: -
Labels:

area-System.Xml, community-contribution

Milestone: -

@kronic kronic requested a review from krwq October 6, 2021 09:14
@eiriktsarpalis
Copy link
Member

Hi @kronic, curious why the PR was closed?

@kronic kronic reopened this Oct 18, 2021
@kronic
Copy link
Contributor Author

kronic commented Oct 18, 2021

@eiriktsarpalis Hello, closed by mistake

Copy link
Member

@eiriktsarpalis eiriktsarpalis left a comment

Choose a reason for hiding this comment

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

LGTM although might need another pair of eyes.

@kronic
Copy link
Contributor Author

kronic commented Oct 27, 2021

ping @eiriktsarpalis @krwq

@@ -1592,8 +1592,7 @@ private void PopNamespaces(int indexFrom, int indexTo)
private string GeneratePrefix()
{
int temp = _stack[_top].prefixCount++ + 1;
return "d" + _top.ToString("d", CultureInfo.InvariantCulture)
+ "p" + temp.ToString("d", CultureInfo.InvariantCulture);
return $"d{_top.ToString("d", CultureInfo.InvariantCulture)}p{temp.ToString("d", CultureInfo.InvariantCulture)}";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return $"d{_top.ToString("d", CultureInfo.InvariantCulture)}p{temp.ToString("d", CultureInfo.InvariantCulture)}";
return string.Create(CultureInfo.InvariantCulture, $"d{_top}p{temp}";

Copy link
Contributor Author

@kronic kronic Nov 8, 2021

Choose a reason for hiding this comment

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

@stephentoub maybe

string.Create(CultureInfo.InvariantCulture, $"d{_top:d}p{temp:d}";

@eiriktsarpalis eiriktsarpalis force-pushed the Convert_concatenation_to_interpolation branch from a3a0ec8 to 82feb68 Compare November 8, 2021 12:56
@eiriktsarpalis
Copy link
Member

Thank you @kronic!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Xml community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants