diff --git a/README.md b/README.md
index c3791e9..e195837 100644
--- a/README.md
+++ b/README.md
@@ -23,9 +23,9 @@ Manually checking properties for emptinness leaves an opportunity to miss someth
* [Nunit](https://www.nuget.org/packages/kasthack.NotEmpty.Nunit/)
* [Xunit](https://www.nuget.org/packages/kasthack.NotEmpty.Xunit/)
* [MsTest](https://www.nuget.org/packages/kasthack.NotEmpty.MsTest/)
-* [Plain .NET](https://www.nuget.org/packages/kasthack.NotEmpty.Raw/)
+* [<no frameworks>](https://www.nuget.org/packages/kasthack.NotEmpty.Raw/)
-2. Check your objects / their properties for emptinness.
+2. Check your objects / their properties for emptinness. Look at the tests for more details.
````csharp
using kasthack.NotEmpty.Xunit; // replace the namespace to match your test framework
diff --git a/src/kasthack.NotEmpty.Core/NotEmptyExtensionsBase.cs b/src/kasthack.NotEmpty.Core/NotEmptyExtensionsBase.cs
index 73539d6..cb90078 100644
--- a/src/kasthack.NotEmpty.Core/NotEmptyExtensionsBase.cs
+++ b/src/kasthack.NotEmpty.Core/NotEmptyExtensionsBase.cs
@@ -9,7 +9,7 @@ public abstract class NotEmptyExtensionsBase
{
public void NotEmpty(T? value)
{
- // workaround for boxed structs
+ // workaround for boxed structs passed as objects
if (value is not null && typeof(T) == typeof(object) && value.GetType() != typeof(object))
{
this.NotEmptyBoxed(value, null!);
@@ -23,6 +23,7 @@ public void NotEmpty(T? value)
private void NotEmptyInternal(T? value, string? path = null)
{
string message = GetEmptyMessage(path);
+ this.Assert(value is not null, message); //fast lane
this.Assert(!EqualityComparer.Default.Equals(default!, value!), message);
switch (value)
{
@@ -48,10 +49,7 @@ private void NotEmptyInternal(T? value, string? path = null)
}
}
- private static string GetEmptyMessage(string? path)
- {
- return $"value{path} is empty";
- }
+ private static string GetEmptyMessage(string? path) => $"value{path} is empty";
private void NotEmptyBoxed(object? value, string? path)
{
@@ -65,9 +63,9 @@ private static class CachedEmptyDelegate
.GetMethod(nameof(NotEmptyExtensionsBase.NotEmptyInternal), BindingFlags.NonPublic | BindingFlags.Instance)!
.GetGenericMethodDefinition();
- private static readonly Dictionary> Delegates = new();
+ private static readonly Dictionary> Delegates = new();
- public static Action