@@ -264,7 +264,7 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
264
264
265
265
/// Call `body(p)`, where `p` is an `UnsafeBufferPointer` over the
266
266
/// underlying contiguous storage.
267
- public func withUnsafeBufferPointer< R> (
267
+ internal func withUnsafeBufferPointer< R> (
268
268
_ body: @noescape ( UnsafeBufferPointer < Element > ) throws -> R
269
269
) rethrows -> R {
270
270
defer { _fixLifetime ( self ) }
@@ -274,7 +274,7 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
274
274
275
275
/// Call `body(p)`, where `p` is an `UnsafeMutableBufferPointer`
276
276
/// over the underlying contiguous storage.
277
- public mutating func withUnsafeMutableBufferPointer< R> (
277
+ internal mutating func withUnsafeMutableBufferPointer< R> (
278
278
_ body: @noescape ( UnsafeMutableBufferPointer < Element > ) throws -> R
279
279
) rethrows -> R {
280
280
defer { _fixLifetime ( self ) }
@@ -284,7 +284,7 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
284
284
285
285
//===--- _ArrayBufferProtocol conformance -----------------------------------===//
286
286
/// Create an empty buffer.
287
- public init ( ) {
287
+ internal init ( ) {
288
288
__bufferPointer = ManagedBufferPointer (
289
289
_uncheckedUnsafeBufferObject: _emptyArrayStorage)
290
290
}
@@ -294,7 +294,7 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
294
294
self = buffer
295
295
}
296
296
297
- public mutating func requestUniqueMutableBackingBuffer(
297
+ internal mutating func requestUniqueMutableBackingBuffer(
298
298
minimumCapacity: Int
299
299
) -> _ContiguousArrayBuffer < Element > ? {
300
300
if _fastPath ( isUniquelyReferenced ( ) && capacity >= minimumCapacity) {
@@ -303,29 +303,29 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
303
303
return nil
304
304
}
305
305
306
- public mutating func isMutableAndUniquelyReferenced( ) -> Bool {
306
+ internal mutating func isMutableAndUniquelyReferenced( ) -> Bool {
307
307
return isUniquelyReferenced ( )
308
308
}
309
309
310
- public mutating func isMutableAndUniquelyReferencedOrPinned( ) -> Bool {
310
+ internal mutating func isMutableAndUniquelyReferencedOrPinned( ) -> Bool {
311
311
return isUniquelyReferencedOrPinned ( )
312
312
}
313
313
314
314
/// If this buffer is backed by a `_ContiguousArrayBuffer`
315
315
/// containing the same number of elements as `self`, return it.
316
316
/// Otherwise, return `nil`.
317
- public func requestNativeBuffer( ) -> _ContiguousArrayBuffer < Element > ? {
317
+ internal func requestNativeBuffer( ) -> _ContiguousArrayBuffer < Element > ? {
318
318
return self
319
319
}
320
320
321
321
@_versioned
322
- func getElement( _ i: Int ) -> Element {
322
+ internal func getElement( _ i: Int ) -> Element {
323
323
_sanityCheck ( i >= 0 && i < count, " Array index out of range " )
324
324
return firstElementAddress [ i]
325
325
}
326
326
327
327
/// Get or set the value of the ith element.
328
- public subscript( i: Int ) -> Element {
328
+ internal subscript( i: Int ) -> Element {
329
329
get {
330
330
return getElement ( i)
331
331
}
@@ -343,7 +343,7 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
343
343
}
344
344
345
345
/// The number of elements the buffer stores.
346
- public var count : Int {
346
+ internal var count : Int {
347
347
get {
348
348
return __bufferPointer. header. count
349
349
}
@@ -369,15 +369,15 @@ internal struct _ContiguousArrayBuffer<Element> : _ArrayBufferProtocol {
369
369
}
370
370
371
371
/// The number of elements the buffer can store without reallocation.
372
- public var capacity : Int {
372
+ internal var capacity : Int {
373
373
return __bufferPointer. header. capacity
374
374
}
375
375
376
376
/// Copy the elements in `bounds` from this buffer into uninitialized
377
377
/// memory starting at `target`. Return a pointer "past the end" of the
378
378
/// just-initialized memory.
379
379
@discardableResult
380
- public func _copyContents(
380
+ internal func _copyContents(
381
381
subRange bounds: Range < Int > ,
382
382
initializing target: UnsafeMutablePointer < Element >
383
383
) -> UnsafeMutablePointer < Element > {
@@ -528,19 +528,19 @@ extension _ContiguousArrayBuffer : RandomAccessCollection {
528
528
/// The position of the first element in a non-empty collection.
529
529
///
530
530
/// In an empty collection, `startIndex == endIndex`.
531
- public var startIndex : Int {
531
+ internal var startIndex : Int {
532
532
return 0
533
533
}
534
534
/// The collection's "past the end" position.
535
535
///
536
536
/// `endIndex` is not a valid argument to `subscript`, and is always
537
537
/// reachable from `startIndex` by zero or more applications of
538
538
/// `index(after:)`.
539
- public var endIndex : Int {
539
+ internal var endIndex : Int {
540
540
return count
541
541
}
542
542
543
- public typealias Indices = CountableRange < Int >
543
+ internal typealias Indices = CountableRange < Int >
544
544
}
545
545
546
546
extension Sequence {
@@ -575,13 +575,13 @@ internal func _copySequenceToContiguousArray<
575
575
}
576
576
577
577
extension Collection {
578
- public func _copyToContiguousArray( ) -> ContiguousArray < Iterator . Element > {
578
+ internal func _copyToContiguousArray( ) -> ContiguousArray < Iterator . Element > {
579
579
return _copyCollectionToContiguousArray ( self )
580
580
}
581
581
}
582
582
583
583
extension _ContiguousArrayBuffer {
584
- public func _copyToContiguousArray( ) -> ContiguousArray < Element > {
584
+ internal func _copyToContiguousArray( ) -> ContiguousArray < Element > {
585
585
return ContiguousArray ( _buffer: self )
586
586
}
587
587
}
0 commit comments