Re: Data, enumerateBytes: separate blocks?
> On Dec 25, 2017, at 2:09 PM, Quincey Morris >wrote: > > So, if your goal is to minimize searching, you have to search for CR and LF > simultaneously. There are two easy ways to do this: > > 1. Use “index(where:)” and test for both values in the closure.
Re: Data, enumerateBytes: separate blocks?
On Dec 27, 2017, at 11:59 , Daryle Walkerwrote: > >> guard let firstBreak = index(where: { >> [MyConstants.cr, MyConstants.lf].contains($0) >> }) else { return nil } I would be inclined to code it like this: > guard let firstBreak =