<commit_before>//
//  SequenceType.swift
//  Vinyl
//
//  Created by <NAME> on 16/02/2016.
//  Copyright © 2016 Velhotes. All rights reserved.
//

import Foundation

extension SequenceType {
    
    func any(f: Generator.Element -> Bool) -> Bool {
        
        for element in self where f(element) {
            return true
        }
        
        return false
    }
    
    func all(f: Generator.Element -> Bool) -> Bool {
        
        let result = self.map(f)
        let and: (Bool, Bool) -> Bool =  {lhs, rhs in lhs && rhs }
        
        return result.reduce(true, combine: and)
    }
}<commit_msg>Early bailout or the performance gods will hunt me<commit_after>//
//  SequenceType.swift
//  Vinyl
//
//  Created by <NAME> on 16/02/2016.
//  Copyright © 2016 Velhotes. All rights reserved.
//

import Foundation

extension SequenceType {
    
    func any(f: Generator.Element -> Bool) -> Bool {
        
        for element in self where f(element) {
            return true
        }
        
        return false
    }
    
    func all(f: Generator.Element -> Bool) -> Bool {
        
        for element in self where f(element) == false {
            return false
        }
        
        return true
    }
}
{'fraction_non_alphanumeric': 0.1059013742926435, 'fraction_numerical': 0.019401778496362168, 'mean_word_length': 1.5738045738045738, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 14, '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': '5431324', 'n_tokens_mistral': 403, 'n_tokens_neox': 364, 'n_words': 114}