Skip to content

Commit 634b6c7

Browse files
committed
🔖 Chasm.Utilities v3.0.0
1 parent cf06b44 commit 634b6c7

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

Chasm.Utilities/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Chasm.Utilities Changelog
22

3-
### v3.0.0 (next)
3+
### v3.0.0
44
- 💥⚡️ Overhauled `ReaderWriterLockSlimExtensions.With[…]Lock()` extensions, now with almost no overhead;
5+
- 📝 Updated README to say that this package is not meant for performance-critical scenarios;
56

67
### v2.5.3
78
- ⚡️ Replaced `throw new ArgumentNullException()` with `ArgumentNullException.ThrowIfNull` in some places;

Chasm.Utilities/Chasm.Utilities.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<!-- Header -->
2727
<AssemblyName>Chasm.Utilities</AssemblyName>
2828
<PackageId>$(AssemblyName)</PackageId>
29-
<Version>2.5.3</Version>
29+
<Version>3.0.0</Version>
3030

3131
<!-- Title, Description, Tags -->
3232
<Title>$(AssemblyName)</Title>

Chasm.Utilities/README.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
[![Latest NuGet version](https://img.shields.io/nuget/v/Chasm.Utilities)](https://www.nuget.org/packages/Chasm.Utilities/)
44
[![MIT License](https://img.shields.io/github/license/Chasmical/Chasm)](../LICENSE)
55

6-
Provides various utility types and methods.
6+
Provides various utility types and methods, for code that needs to be written quickly, and not necessarily efficiently.
7+
8+
> [!WARNING]
9+
> ████ **Don't use this package in performance-critical scenarios!** ████
10+
> Many methods don't get inlined properly, and even if they do, there's still some overhead.
11+
> As such, appropriate uses of this library would be: writing quick tests, proofs-of-concept and mock-ups.
712
813

914

@@ -37,14 +42,14 @@ var ex = Util.Catch(doSomething, out object? result);
3742

3843
```cs
3944
// Commonly written as:
40-
if (a is string textA) { /* ... */ }
41-
else if (b is string textB) { /* ... */ }
42-
else if (c is string textC) { /* ... */ }
45+
if (a is BigInteger bigInt_1) { /* ... */ }
46+
else if (b is BigInteger bigInt_2) { /* ... */ }
47+
else if (c is BigInteger bigInt_3) { /* ... */ }
4348

4449
// Using Util.Is:
45-
if (a is string text) { /* ... */ }
46-
else if (Util.Is(b, out text)) { /* ... */ }
47-
else if (Util.Is(c, out text)) { /* ... */ }
50+
if (a is BigInteger bigInt) { /* ... */ }
51+
else if (Util.Is(b, out bigInt)) { /* ... */ }
52+
else if (Util.Is(c, out bigInt)) { /* ... */ }
4853
```
4954

5055
`Util.With` can be used to invoke functions while `using` a `IDisposable`:
@@ -73,7 +78,7 @@ Util.Swap(ref firstVariable, ref secondVariable);
7378

7479
## `DelegateDisposable`
7580

76-
`DelegateDisposable` is a `IDisposable` interface implementation that invokes an action on disposal.
81+
`DelegateDisposable` is an `IDisposable` interface implementation that invokes an action on disposal.
7782

7883
```cs
7984
store.Subscribe(listenerFunc);
@@ -86,6 +91,8 @@ var listener = DelegateDisposable.Create(
8691
);
8792
```
8893

94+
95+
8996
## `ReaderWriterLockSlimExtensions`
9097

9198
`ReaderWriterLockSlimExtensions` makes use of specialized variants of `DelegateDisposable` to enter and exit locks.
@@ -108,3 +115,5 @@ finally
108115
using (rwl.WithReaderLock())
109116
/* ... */
110117
```
118+
119+

0 commit comments

Comments
 (0)