You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regarding NSString, this method has a performance advantage compared with lineRange(for:) by passing nil to one or two of the first three parameters, because then, the method doesn't try finding those boundaries. This characteristic is mentioned also in the reference. However, in the Swift.String version, it accepts only non-optional UnsafeMutablePointer<Self.Index>; so there is no way to get only a single boundary of a line range.
This is actually not a bug but undesirable behavior (so please change the issue type if it's wrong). The same issue exists also in getParagraphStart(_:end:contentsEnd:for:).
Expected Result
The parameters start, end, and contentsEnd accept nil so that the method can skip finding needless indexes.
The text was updated successfully, but these errors were encountered:
Environment
Apple Swift version 5.1.3 (swiftlang-1100.0.282.1 clang-1100.0.33.15)
Target: x86_64-apple-darwin19.2.0
macOS: 10.15.2 (19C57)
Xcode: 11.3.1 (11C504)
Additional Detail from JIRA
md5: f54a27386cf85cdae238ae154fefd318
Issue Description:
Description
Swift.String has the method
getLineStart(_:end:contentsEnd:for:)
that is corresponding to the same name method in NSString to get the character indexes for its line boundary.Regarding NSString, this method has a performance advantage compared with
lineRange(for:)
by passingnil
to one or two of the first three parameters, because then, the method doesn't try finding those boundaries. This characteristic is mentioned also in the reference. However, in the Swift.String version, it accepts only non-optionalUnsafeMutablePointer<Self.Index>
; so there is no way to get only a single boundary of a line range.This is actually not a bug but undesirable behavior (so please change the issue type if it's wrong). The same issue exists also in
getParagraphStart(_:end:contentsEnd:for:)
.Expected Result
The parameters
start
,end
, andcontentsEnd
acceptnil
so that the method can skip finding needless indexes.The text was updated successfully, but these errors were encountered: