mirror of
https://github.com/github/codeql.git
synced 2025-12-17 09:13:20 +01:00
20 lines
527 B
C#
20 lines
527 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 enumerble/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;
|
|
}
|
|
}
|
|
}
|