13
13
// COW helpers
14
14
extension _StringGuts {
15
15
internal var nativeCapacity : Int ? {
16
- guard hasNativeStorage else { return nil }
17
- return _object. withNativeStorage { $0. capacity }
16
+ @inline ( never)
17
+ @_effects ( releasenone)
18
+ get {
19
+ guard hasNativeStorage else { return nil }
20
+ return _object. withNativeStorage { $0. capacity }
21
+ }
18
22
}
19
23
20
24
internal var nativeUnusedCapacity : Int ? {
21
- guard hasNativeStorage else { return nil }
22
- return _object. withNativeStorage { $0. unusedCapacity }
25
+ @inline ( never)
26
+ @_effects ( releasenone)
27
+ get {
28
+ guard hasNativeStorage else { return nil }
29
+ return _object. withNativeStorage { $0. unusedCapacity }
30
+ }
23
31
}
24
32
25
33
// If natively stored and uniquely referenced, return the storage's total
26
34
// capacity. Otherwise, nil.
27
35
internal var uniqueNativeCapacity : Int ? {
28
- @inline ( __always) mutating get {
36
+ @inline ( never)
37
+ @_effects ( releasenone)
38
+ mutating get {
29
39
guard isUniqueNative else { return nil }
30
40
return _object. withNativeStorage { $0. capacity }
31
41
}
@@ -34,7 +44,9 @@ extension _StringGuts {
34
44
// If natively stored and uniquely referenced, return the storage's spare
35
45
// capacity. Otherwise, nil.
36
46
internal var uniqueNativeUnusedCapacity : Int ? {
37
- @inline ( __always) mutating get {
47
+ @inline ( never)
48
+ @_effects ( releasenone)
49
+ mutating get {
38
50
guard isUniqueNative else { return nil }
39
51
return _object. withNativeStorage { $0. unusedCapacity }
40
52
}
0 commit comments