Guest User

Untitled

a guest
Jul 19th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. private static IEnumerable<TSource> SkipWhileImpl<TSource>(
  2. IEnumerable<TSource> source,
  3. Func<TSource, bool> predicate)
  4. {
  5. using (IEnumerator<TSource> iterator = source.GetEnumerator())
  6. {
  7. do
  8. {
  9. if (!iterator.MoveNext())
  10. yield break;
  11. } while (predicate(iterator.Current));
  12.  
  13. do
  14. {
  15. yield return iterator.Current;
  16. } while (iterator.MoveNext());
  17. }
  18. }
Add Comment
Please, Sign In to add comment