File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change 1919 <Description >PrimeFuncPack Core.Unit is a core library for .NET consisting of Unit type targeted for use in functional programming.</Description >
2020 <RootNamespace >System</RootNamespace >
2121 <AssemblyName >PrimeFuncPack.Core.Unit</AssemblyName >
22- <Version >4.0.0-rc.1 </Version >
22+ <Version >4.0.0</Version >
2323 </PropertyGroup >
2424
2525 <ItemGroup >
Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ internal static class UnitFormUtf8
1717 internal static ReadOnlySpan < byte > JsonObjExtended => new ( InnerBytes . JsonObjExtended ) ;
1818 internal static ReadOnlySpan < byte > EmptyExtended => new ( InnerBytes . EmptyExtended ) ;
1919
20+ // We initialize the byte arrays inline with no static ctor to obtain and cache them
21+ // lazily only on demand, and also isolate them in a nested class for thread-safety.
2022 private static class InnerBytes
2123 {
2224 internal static readonly byte [ ] General = InnerGetBytes ( UnitForm . General ) ;
@@ -29,6 +31,7 @@ private static class InnerBytes
2931 internal static readonly byte [ ] JsonObjExtended = InnerGetBytes ( UnitForm . JsonObjExtended ) ;
3032 internal static readonly byte [ ] EmptyExtended = InnerGetBytes ( UnitForm . EmptyExtended ) ;
3133
34+ // We use the most proven method to obtain UTF-8 bytes.
3235 private static byte [ ] InnerGetBytes ( string s )
3336 =>
3437 Encoding . UTF8 . GetBytes ( s ) ;
You can’t perform that action at this time.
0 commit comments