stdlib/Unicode: allow transcode() to operate on mutable value-typed

sinks

Swift SVN r22302
This commit is contained in:
Dmitri Hrybenko
2014-09-26 17:28:00 +00:00
parent 92dc4ee237
commit a04ee3a463
8 changed files with 123 additions and 106 deletions

View File

@@ -691,8 +691,8 @@ public func transcode<
where InputEncoding.CodeUnit == Input.Element,
OutputEncoding.CodeUnit == Output.Element>(
inputEncoding: InputEncoding.Type, outputEncoding: OutputEncoding.Type,
var input: Input, var output: Output, #stopOnError: Bool
) -> (Bool) {
var input: Input, inout output: Output, #stopOnError: Bool
) -> Bool {
// NB. It is not possible to optimize this routine to a memcpy if
// InputEncoding == OutputEncoding. The reason is that memcpy will not
@@ -716,7 +716,7 @@ public func transcode<
hadError = true
}
}
return (hadError: hadError)
return hadError
}
/// Transcode UTF-16 to UTF-8, replacing ill-formed sequences with U+FFFD.