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.98 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.97 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.96 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.95 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.94 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.93 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.92 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.91 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.90 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.89 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.88 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.87 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.86 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.85 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.84 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.83 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.82 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.81 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.80 tracks/swift/exercises/strain/Sources/StrainExample.swift
trackler-2.2.1.79 tracks/swift/exercises/strain/Sources/StrainExample.swift