Skip to content

Commit b49b5c4

Browse files
committed
Fix print method syntax and revert whitespace
* Remove terminator argument in print method because the default terminator is "\n". * Revert removed trailing whitespace by the previous commit
1 parent d2c273b commit b49b5c4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

stdlib/public/core/Arrays.swift.gyb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,11 @@ if True:
230230
/// are `nil`.
231231
///
232232
/// if let firstElement = oddNumbers.first, lastElement = oddNumbers.last {
233-
/// print(firstElement, lastElement, separator: ", ", terminator: "\n")
233+
/// print(firstElement, lastElement, separator: ", ")
234234
/// }
235235
/// // Prints "1, 15"
236236
///
237-
/// print(emptyDoubles.first, emptyDoubles.last, separator: ", ", terminator: "\n")
237+
/// print(emptyDoubles.first, emptyDoubles.last, separator: ", ")
238238
/// // Prints "nil, nil"
239239
///
240240
/// You can access individual array elements through a subscript. The first
@@ -243,7 +243,7 @@ if True:
243243
/// the count of the array. Using a negative number or an index equal to or
244244
/// greater than `count` triggers a runtime error. For example:
245245
///
246-
/// print(oddNumbers[0], oddNumbers[3], separator: ", ", terminator: "\n")
246+
/// print(oddNumbers[0], oddNumbers[3], separator: ", ")
247247
/// // Prints "1, 7"
248248
///
249249
/// print(emptyDoubles[0])
@@ -621,10 +621,10 @@ ${SubscriptDocComment}
621621
public subscript(index: Int) -> Element {
622622
get {
623623
// This call may be hoisted or eliminated by the optimizer. If
624-
// there is an inout violation, this value may be stale so needs to be
624+
// there is an inout violation, this value may be stale so needs to be
625625
// checked again below.
626626
let wasNativeTypeChecked = _hoistableIsNativeTypeChecked()
627-
627+
628628
// Make sure the index is in range and wasNativeTypeChecked is
629629
// still valid.
630630
let token = _checkSubscript(
@@ -636,7 +636,7 @@ ${SubscriptDocComment}
636636
}
637637
mutableAddressWithPinnedNativeOwner {
638638
_makeMutableAndUniqueOrPinned() // makes the array native, too
639-
_checkSubscript_native(index)
639+
_checkSubscript_native(index)
640640
return (_getElementAddress(index), Builtin.tryPin(_getOwner_native()))
641641
}
642642
}
@@ -752,7 +752,7 @@ ${SubscriptDocComment}
752752
// We are hiding the access to '_buffer.owner' behind
753753
// _getOwner() to help the compiler hoist uniqueness checks in
754754
// the case of class or Objective-C existential typed array
755-
// elements.
755+
// elements.
756756
return _getOwnerWithSemanticLabel_native()
757757
}
758758
#endif
@@ -992,12 +992,12 @@ extension ${Self} : RangeReplaceableCollection, _ArrayProtocol {
992992
/// func cacheImagesWithNames(names: [String]) {
993993
/// // custom image loading and caching
994994
/// }
995-
///
995+
///
996996
/// let namedHues: [String: Int] = ["Vermillion": 18, "Magenta": 302,
997997
/// "Gold": 50, "Cerise": 320]
998998
/// let colorNames = Array(namedHues.keys)
999999
/// cacheImagesWithNames(colorNames)
1000-
///
1000+
///
10011001
/// print(colorNames)
10021002
/// // Prints "["Gold", "Cerise", "Magenta", "Vermillion"]"
10031003
///
@@ -1084,15 +1084,15 @@ extension ${Self} : RangeReplaceableCollection, _ArrayProtocol {
10841084
internal static func _adoptStorage(
10851085
_ storage: AnyObject, count: Int
10861086
) -> (Array, UnsafeMutablePointer<Element>) {
1087-
1087+
10881088
_sanityCheck(
10891089
storage is _ContiguousArrayStorage<Element>, "Invalid array storage type")
1090-
1090+
10911091
let innerBuffer = _ContiguousArrayBuffer<Element>(
10921092
count: count,
10931093
storage: unsafeDowncast(
10941094
storage, to: _ContiguousArrayStorage<Element>.self))
1095-
1095+
10961096
return (
10971097
Array(_Buffer(innerBuffer, shiftedToStartIndex: 0)),
10981098
innerBuffer.firstElementAddress)

0 commit comments

Comments
 (0)