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

namespace SemVer
{
    public class Range
    {
        private readonly IEnumerable<ComparatorSet> _comparatorSets;

        public Range(string rangeSpec)
        {
            var comparatorSetSpecs = rangeSpec.Split(new [] {"||"}, StringSplitOptions.None);
            _comparatorSets = comparatorSetSpecs.Select(s => new ComparatorSet(s));
        }

        public bool Match(Version version)
        {
            return _comparatorSets.Any(s => s.Match(version));
        }

        public bool Match(string version)
        {
            return _comparatorSets.Any(s => s.Match(new Version(version)));
        }

        public IEnumerable<Version> Filter(IEnumerable<Version> versions)
        {
            return versions.Where(Match);
        }

        public IEnumerable<string> Filter(IEnumerable<string> versions)
        {
            return versions.Where(Match);
        }

        public Version Select(IEnumerable<Version> versions)
        {
            return Filter(versions).Max();
        }

        public string Select(IEnumerable<string> versionStrings)
        {
            var versions = versionStrings.Select(s => new Version(s));
            var maxVersion = Filter(versions).Max();
            return maxVersion == null ? null : maxVersion.ToString();
        }
    }
}<commit_msg>Small tidy up<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace SemVer
{
    public class Range
    {
        private readonly IEnumerable<ComparatorSet> _comparatorSets;

        public Range(string rangeSpec)
        {
            var comparatorSetSpecs = rangeSpec.Split(new [] {"||"}, StringSplitOptions.None);
            _comparatorSets = comparatorSetSpecs.Select(s => new ComparatorSet(s));
        }

        public bool Match(Version version)
        {
            return _comparatorSets.Any(s => s.Match(version));
        }

        public bool Match(string versionString)
        {
            var version = new Version(versionString);
            return Match(version);
        }

        public IEnumerable<Version> Filter(IEnumerable<Version> versions)
        {
            return versions.Where(Match);
        }

        public IEnumerable<string> Filter(IEnumerable<string> versions)
        {
            return versions.Where(Match);
        }

        public Version Select(IEnumerable<Version> versions)
        {
            return Filter(versions).Max();
        }

        public string Select(IEnumerable<string> versionStrings)
        {
            var versions = versionStrings.Select(s => new Version(s));
            var maxVersion = Select(versions);
            return maxVersion == null ? null : maxVersion.ToString();
        }
    }
}
{'fraction_non_alphanumeric': 0.09626998223801066, 'fraction_numerical': 0.0, 'mean_word_length': 2.1640449438202247, 'pattern_counts': {'":': 0, '<': 17, '<?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': '7080463', 'n_tokens_mistral': 714, 'n_tokens_neox': 704, 'n_words': 156}