Reading List

Speeding Up Scanner in Swift from Michael Tsai RSS feed.

Speeding Up Scanner in Swift

My first tip goes back to when I started using NSScanner in the Puma days. In short, you should never call scanCharacters(from:into:) in a loop because every time it’s called it creates an inverted copy of the character set. It then delegates to NSString.rangeOfCharacter(from:options:range:), passing that copy. The documentation contains the cryptic comment: Using the […]