What is Nostr?
anatawa12 :vrc::unity::unityerror: /
npub1k3t…rgzc
2024-09-01 10:24:29

anatawa12 :vrc::unity::unityerror: on Nostr: public static IEnumerable<(T, T)> ZipWithNext<T>(this IEnumerable<T> enumerable) { ...



public static IEnumerable<(T, T)> ZipWithNext<T>(this IEnumerable<T> enumerable)
{
using (var enumerator = enumerable.GetEnumerator())
{
if (!enumerator.MoveNext()) yield break;
var prev = enumerator.Current;
while (enumerator.MoveNext())
{
var current = enumerator.Current;
yield return (prev, current);
prev = current;
}
}
}
地味だけど便利なやつ
Author Public Key
npub1k3tgjp6d06qp25j4a234t0j2xg58knm20ea4d6en7kht0qvvm5fs73rgzc