diff --git a/Badeend.ValueCollections/ValueListBuilder.cs b/Badeend.ValueCollections/ValueListBuilder.cs index 00bbcf5..be0f1bd 100644 --- a/Badeend.ValueCollections/ValueListBuilder.cs +++ b/Badeend.ValueCollections/ValueListBuilder.cs @@ -105,6 +105,15 @@ private List Mutate() /// public int Count => this.Read().Count; + /// + /// Shortcut for .Count == 0. + /// + public bool IsEmpty + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.Count == 0; + } + /// bool ICollection.IsReadOnly => false; diff --git a/Badeend.ValueCollections/ValueSetBuilder.cs b/Badeend.ValueCollections/ValueSetBuilder.cs index 3da6a13..1b81174 100644 --- a/Badeend.ValueCollections/ValueSetBuilder.cs +++ b/Badeend.ValueCollections/ValueSetBuilder.cs @@ -109,6 +109,15 @@ private static IEnumerable PreferHashSet(IEnumerable input) /// public int Count => this.Read().Count; + /// + /// Shortcut for .Count == 0. + /// + public bool IsEmpty + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => this.Count == 0; + } + /// bool ICollection.IsReadOnly => false;