[swift-evolution] (Draft) Add last(where:) and lastIndex(where:) methods

Brent Royal-Gordon brent at architechies.com
Sat May 21 16:58:22 CDT 2016


>        var result: Index? = nil
>        for i in indices { 
>          if predicate(self[i]) { result = i }
>        }
>        return result

That is better! I didn't think to just give up on testing the minimum number of elements.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list