Files
codeql/csharp/extractor/Semmle.Util/Enumerators.cs
Josh Soref 0ecc7cb67a spelling: enumerable
Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2022-10-19 03:49:16 -04:00

20 lines
528 B
C#

using System.Collections.Generic;
namespace Semmle.Util
{
public static class Enumerators
{
/// <summary>
/// Create an enumerable with a single element.
/// </summary>
///
/// <typeparam name="T">The type of the enumerable/element.</typeparam>
/// <param name="t">The element.</param>
/// <returns>An enumerable containing a single element.</returns>
public static IEnumerable<T> Singleton<T>(T t)
{
yield return t;
}
}
}