<commit_before>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Linq;

namespace ReClassNET.Extensions
{
	public static class LinqExtension
	{
		public static TResult Max<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector, IComparer<TResult> comparer)
		{
			comparer = comparer ?? Comparer<TResult>.Default;

			using (var it = source.GetEnumerator())
			{
				if (!it.MoveNext())
				{
					throw new InvalidOperationException();
				}

				var max = selector(it.Current);
				while (it.MoveNext())
				{
					var current = selector(it.Current);
					if (comparer.Compare(current, max) > 0)
					{
						max = current;
					}
				}
				return max;
			}
		}

		public static TResult Min<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector, IComparer<TResult> comparer)
		{
			comparer = comparer ?? Comparer<TResult>.Default;

			using (var it = source.GetEnumerator())
			{
				if (!it.MoveNext())
				{
					throw new InvalidOperationException();
				}

				var min = selector(it.Current);
				while (it.MoveNext())
				{
					var current = selector(it.Current);
					if (comparer.Compare(current, min) < 0)
					{
						min = current;
					}
				}
				return min;
			}
		}

		[DebuggerStepThrough]
		public static bool None<TSource>(this IEnumerable<TSource> source)
		{
			Contract.Requires(source != null);

			return !source.Any();
		}

		[DebuggerStepThrough]
		public static bool None<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
		{
			Contract.Requires(source != null);<commit_msg>Removed unused methods.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Linq;

namespace ReClassNET.Extensions
{
	public static class LinqExtension
	{
		[DebuggerStepThrough]
		public static bool None<TSource>(this IEnumerable<TSource> source)
		{
			Contract.Requires(source != null);

			return !source.Any();
		}

		[DebuggerStepThrough]
		public static bool None<TSource>(this IEnumerable<TSource> source, Func<TSource, bool> predicate)
		{
			Contract.Requires(source != null);
{'fraction_non_alphanumeric': 0.11603942652329749, 'fraction_numerical': 0.0008960573476702509, 'mean_word_length': 3.791845493562232, 'pattern_counts': {'":': 0, '<': 24, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '237532', 'n_tokens_mistral': 850, 'n_tokens_neox': 697, 'n_words': 159}