stdlib: rename RangeReplaceableCollectionType.extend() to appendContentsOf()

rdar://21972324

Swift SVN r30607
This commit is contained in:
Dmitri Hrybenko
2015-07-25 00:36:37 +00:00
parent 1a61bab17c
commit d97ac3e64c
22 changed files with 64 additions and 62 deletions

View File

@@ -50,7 +50,7 @@ import SwiftShims
///
/// var a = "foo"
/// var b = a
/// b.extend("bar")
/// b.appendContentsOf("bar")
/// print("a=\(a), b=\(b)") // a=foo, b=foobar
///
/// Strings use Copy-on-Write so that their data is only copied
@@ -414,7 +414,7 @@ public func <(lhs: String, rhs: String) -> Bool {
extension String {
/// Append the elements of `other` to `self`.
public mutating func extend(other: String) {
public mutating func appendContentsOf(other: String) {
_core.append(other._core)
}
@@ -573,11 +573,13 @@ extension String {
}
}
public mutating func extend<
public mutating func appendContentsOf<
S : SequenceType
where S.Generator.Element == Character
>(newElements: S) {
withMutableCharacters { (inout v: CharacterView) in v.extend(newElements) }
withMutableCharacters {
(inout v: CharacterView) in v.appendContentsOf(newElements)
}
}
/// Create an instance containing `characters`.