@@ -329,17 +329,17 @@ public struct _StringCore {
329
329
}
330
330
331
331
/// Write the string, in the given encoding, to output.
332
- func encode<
333
- Encoding : UnicodeCodec
334
- > ( _ encoding : Encoding . Type , output : @noescape ( Encoding . CodeUnit ) -> Void )
332
+ func encode< Encoding : UnicodeCodec > (
333
+ _ encoding : Encoding . Type ,
334
+ sendingOutputTo processCodeUnit : @noescape ( Encoding . CodeUnit ) -> Void )
335
335
{
336
336
if _fastPath ( _baseAddress != nil ) {
337
337
if _fastPath ( elementWidth == 1 ) {
338
338
for x in UnsafeBufferPointer (
339
339
start: UnsafeMutablePointer < UTF8 . CodeUnit > ( _baseAddress!) ,
340
340
count: count
341
341
) {
342
- Encoding . encode ( UnicodeScalar ( UInt32 ( x) ) , sendingOutputTo: output )
342
+ Encoding . encode ( UnicodeScalar ( UInt32 ( x) ) , sendingOutputTo: processCodeUnit )
343
343
}
344
344
}
345
345
else {
@@ -351,7 +351,7 @@ public struct _StringCore {
351
351
from: UTF16 . self,
352
352
to: encoding,
353
353
stoppingOnError: true ,
354
- sendingOutputTo: output
354
+ sendingOutputTo: processCodeUnit
355
355
)
356
356
_sanityCheck ( !hadError, " Swift.String with native storage should not have unpaired surrogates " )
357
357
}
@@ -361,7 +361,7 @@ public struct _StringCore {
361
361
_StringCore (
362
362
_cocoaStringToContiguous (
363
363
source: cocoaBuffer!, range: 0 ..< count, minimumCapacity: 0 )
364
- ) . encode ( encoding, output : output )
364
+ ) . encode ( encoding, sendingOutputTo : processCodeUnit )
365
365
#else
366
366
_sanityCheckFailure ( " encode: non-native string without objc runtime " )
367
367
#endif
0 commit comments