I would vow to remove where clauses altogether. Most of the times I used it in ifs, fors and switches I ended up thinking it hardened readability of my code (perhaps because of placement, but I do not think alternatives made it more readable) and so it was my decision to stop using where whenever possible in my code. Since Erica's performance test pointed out using guard is nearly as fast as using where and the core team is removing wheres from ifs, I think the ones in fors could go next.
L > On 10 Jun 2016, at 2:01 am, Charlie Monroe via swift-evolution > <[email protected]> wrote: > > >> On Jun 9, 2016, at 7:16 PM, Erica Sadun <[email protected]> wrote: >> >> >>> On Jun 9, 2016, at 11:11 AM, Charlie Monroe <[email protected]> >>> wrote: >>> See my latest post - included results with -Ofast. But still, using filter >>> and lazy.filter is 10+% slower, which were the suggested alternatives to >>> `where`. >> >> I need to correct this misapprehension. >> My suggested alternative to where was and remains `guard`. >> >> -- E > > Sorry, meant alternatives that didn't require any additional code in the body > of the for loop. > > _______________________________________________ > swift-evolution mailing list > [email protected] > https://lists.swift.org/mailman/listinfo/swift-evolution _______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
