File tree Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Expand file tree Collapse file tree 2 files changed +2
-15
lines changed Original file line number Diff line number Diff line change @@ -172,20 +172,7 @@ public struct StaticString {
172
172
return body ( UnsafeBufferPointer (
173
173
start: utf8Start, count: utf8CodeUnitCount) )
174
174
} else {
175
- var buffer : UInt64 = 0
176
- var i = 0
177
- let sink : ( UInt8 ) -> Void = {
178
- #if _endian(little)
179
- buffer = buffer | ( UInt64 ( $0) << ( UInt64 ( i) * 8 ) )
180
- #else
181
- buffer = buffer | ( UInt64 ( $0) << ( UInt64 ( 7 - i) * 8 ) )
182
- #endif
183
- i += 1
184
- }
185
- UTF8 . encode ( unicodeScalar, into: sink)
186
- return body ( UnsafeBufferPointer (
187
- start: UnsafePointer ( Builtin . addressof ( & buffer) ) ,
188
- count: i) )
175
+ return unicodeScalar. withUTF8CodeUnits { body ( $0) }
189
176
}
190
177
}
191
178
Original file line number Diff line number Diff line change @@ -136,5 +136,5 @@ class GenericRuncer<T> : Gizmo {
136
136
}
137
137
138
138
// CHECK: define internal swiftcc void [[PARTIAL_FORWARDING_THUNK]](%swift.refcounted* swiftself %0) {{.*}} {
139
- // CHECK: @"$ss12StaticStringV14withUTF8BufferyxxSRys5UInt8VGXElFyAEcfU_ "
139
+ // CHECK: @"$ss12StaticStringV14withUTF8BufferyxxSRys5UInt8VGXElFxAFXEfU_ "
140
140
// CHECK: }
You can’t perform that action at this time.
0 commit comments