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

Add ReadOnlySpan<char> overloads to the DecimalNotationFormatter #91

Open
lipchev opened this issue Nov 21, 2024 · 1 comment
Open

Add ReadOnlySpan<char> overloads to the DecimalNotationFormatter #91

lipchev opened this issue Nov 21, 2024 · 1 comment

Comments

@lipchev
Copy link
Contributor

lipchev commented Nov 21, 2024

In order to easily support the ISpanFormattable interface, see about adding an overload to the DecimalNotationFormatter that works with a ReadOnlySpan<char>

This should further reduce the allocations required for formatting strings that contain a Fraction as part of the format.

This is up for grabs (I'll probably look into it at some point):

@danm-de
Copy link
Owner

danm-de commented Dec 10, 2024

Hey,

I have nothing against the introduction of Span/ReadOnlySpan method overloads. Several people from my work environment pointed out to me, that the use of #if/#else preprocessor directives makes the code confusing.

I may outsource the affected functions to different files in future. Example file layout:

  • Fraction.FromString.cs (general, available in both, netstandard and netcore)
  • Fraction.FromString-netstandard.cs (.NET Standard implementation)
  • Fraction.FromString-netcore.cs (.NET Core implementation)

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

No branches or pull requests

2 participants