Skip to content

Commit f74c020

Browse files
committed
release/v4.0.0
1 parent 58108d7 commit f74c020

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/core-unit/Unit/Unit.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
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>

src/core-unit/Unit/UnitFormatting/UnitFormUtf8.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff 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);

0 commit comments

Comments
 (0)