Sha256: acaae1bf61ac8a9ba4cbdc787baa8b81f60346667fc426d2958833819a06c952

Contents?: true

Size: 412 Bytes

Versions: 396

Compression:

Stored size: 412 Bytes

Contents

extension Array {

    func keep(_ compare: Bool = true, inputFunc: (Element) -> Bool ) -> Array {
        var array2Return: Array = []
        for each in self {
            if inputFunc(each) == compare {
                array2Return.append(each)}
        }
        return array2Return
    }

    func discard(_ inputFunc: (Element) -> Bool) -> Array {
        return keep(false, inputFunc: inputFunc)
    }
}

Version data entries

396 entries across 396 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.179 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.178 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.177 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.176 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.175 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.174 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.173 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.172 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.171 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.170 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.169 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.167 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.166 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.165 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.164 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.163 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.162 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.161 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.160 tracks/swift/exercises/strain/Sources/StrainExample.swift