private static void SkipWhile(int[] source, ref int position, Func<int, bool> filter) { while (position < source.Length && filter(source[position])) { position++; } }