File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -72,10 +72,10 @@ ReadOnlySpan<byte> c = "Hello."u8;
7272string d = " Hello." ; // assuming this string literal is eligible for the `ldsfld` emit strategy
7373```
7474
75- The initialization calls ` <PrivateImplementationDetails>.BytesToString ` helper which in turn calls ` Encoding.UTF8.GetBytes ` .
75+ The initialization calls ` <PrivateImplementationDetails>.BytesToString ` helper which in turn calls ` Encoding.UTF8.GetString ` .
7676This is an optimization so each of the generated static constructors is slightly smaller in IL size.
7777These size savings can add up since one class is generated per one eligible string literal.
78- A compile-time error is reported if the ` Encoding.UTF8.GetBytes ` API is not available and needs to be used
78+ A compile-time error is reported if the ` Encoding.UTF8.GetString ` API is not available and needs to be used
7979(the user can then either ensure the API is available or turn off the feature flag).
8080
8181The following example demonstrates the code generated for string literal ` "Hello." ` .
You can’t perform that action at this time.
0 commit comments