swiftlang / swift-experimental-string-processing

An early experimental general-purpose pattern matching engine for Swift.
Apache License 2.0
278 stars 47 forks source link

Don't operate on a collection and a range of indices if you can help it. #711

Open dabrahams opened 9 months ago

dabrahams commented 9 months ago

I just noticed https://developer.apple.com/documentation/swift/customconsumingregexcomponent/consuming(_:startingat:in:)

In general APIs are cleaner if you just operate on collections and use slices to limit what you're looking at. Obviously if that's not possible in this case, please ignore. Otherwise, please apply as broadly as possible ;-)