public static bool IsEmpty <T>(this IEnumerable <T> enumerable) => !enumerable?.GetEnumerator()?.MoveNext() ?? true;
Example #2
0
 public static void PushRange <T>(this Stack <T> self, IEnumerable <object> collection, bool allowDuplicate)
 => self.PushRange(collection?.GetEnumerator(), allowDuplicate);
Example #3
0
 public static void EnqueueRange <T>(this Queue <T> self, IEnumerable <object> collection, bool allowDuplicate)
 => self.EnqueueRange(collection?.GetEnumerator(), allowDuplicate);
Example #4
0
        /// <inheritdoc />
        IEnumerator IEnumerable.GetEnumerator()
        {
            IEnumerable enumerable = _set;

            return(enumerable.GetEnumerator());
        }