File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -99,12 +99,6 @@ public struct Substring: Sendable {
99
99
100
100
@inline ( __always)
101
101
internal init ( _unchecked slice: Slice < String > ) {
102
- _internalInvariant ( slice. endIndex <= slice. _base. _guts. endIndex)
103
- _internalInvariant (
104
- slice. _base. _guts. hasMatchingEncoding ( slice. startIndex) &&
105
- slice. _base. _guts. hasMatchingEncoding ( slice. endIndex) )
106
- _internalInvariant (
107
- slice. startIndex. _isScalarAligned && slice. endIndex. _isScalarAligned)
108
102
self . _slice = slice
109
103
_invariantCheck ( )
110
104
}
@@ -167,15 +161,12 @@ extension Substring {
167
161
#else
168
162
@usableFromInline @inline ( never) @_effects ( releasenone)
169
163
internal func _invariantCheck( ) {
170
- _internalInvariant ( _slice . endIndex <= _wholeGuts. endIndex)
164
+ _internalInvariant ( endIndex <= _wholeGuts. endIndex)
171
165
_internalInvariant (
172
- _wholeGuts. hasMatchingEncoding ( _slice. startIndex) &&
173
- _wholeGuts. hasMatchingEncoding ( _slice. endIndex) )
174
- // Indices are always scalar aligned
166
+ _wholeGuts. hasMatchingEncoding ( startIndex) &&
167
+ _wholeGuts. hasMatchingEncoding ( endIndex) )
175
168
_internalInvariant (
176
- _slice. startIndex == _wholeGuts. scalarAlign ( _slice. startIndex) &&
177
- _slice. endIndex == _wholeGuts. scalarAlign ( _slice. endIndex) )
178
-
169
+ startIndex. _isScalarAligned && endIndex. _isScalarAligned)
179
170
self . base. _invariantCheck ( )
180
171
}
181
172
#endif // INTERNAL_CHECKS_ENABLED
You can’t perform that action at this time.
0 commit comments