Karoy Lorentey 85d1021e51
rdar://109907151&110477287 Fix StringProtocol.lineRange(for:)/paragraphRange(for:) (#174)
These started by converting `self` into a `String`. This lead to crashes when `self` happened to be a Substring, as the input range isn’t necessarily a valid index range in the resulting string in that case.

While I’m here, review related helper functions to improve performance and to avoid more correctness issues.
2023-06-09 14:21:12 -07:00
..