mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
[BasicContainers, DequeModule] Resolve warnings in 6.4
This commit is contained in:
12 files changed
+14
-14
No files matched your search
@@ -331,7 +331,7 @@ extension RigidArray {
|
||||
/// - Complexity: O(`newElements.count`)
|
||||
@_alwaysEmitIntoClient
|
||||
public mutating func append(copying items: Span<Element>) {
|
||||
unsafe items.withUnsafeBufferPointer { source in
|
||||
items.withUnsafeBufferPointer { source in
|
||||
unsafe self.append(copying: source)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -577,7 +577,7 @@ extension RigidArray {
|
||||
removing subrange: Range<Int>,
|
||||
copying newElements: Span<Element>
|
||||
) {
|
||||
unsafe newElements.withUnsafeBufferPointer { buffer in
|
||||
newElements.withUnsafeBufferPointer { buffer in
|
||||
unsafe self.replace(removing: subrange, copying: buffer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ extension RigidDeque /*where Element: Copyable*/ {
|
||||
/// - Complexity: O(`items.count`)
|
||||
@_alwaysEmitIntoClient
|
||||
public mutating func append(copying items: Span<Element>) {
|
||||
unsafe items.withUnsafeBufferPointer { source in
|
||||
items.withUnsafeBufferPointer { source in
|
||||
unsafe self.append(copying: source)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -350,7 +350,7 @@ extension RigidDeque /* where Element: Copyable */ {
|
||||
public mutating func insert(
|
||||
copying items: Span<Element>, at index: Int
|
||||
) {
|
||||
unsafe items.withUnsafeBufferPointer {
|
||||
items.withUnsafeBufferPointer {
|
||||
unsafe self.insert(copying: $0, at: index)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,7 +282,7 @@ extension RigidDeque /*where Element: Copyable*/ {
|
||||
@inlinable
|
||||
@_alwaysEmitIntoClient
|
||||
public mutating func prepend(copying items: Span<Element>) {
|
||||
unsafe items.withUnsafeBufferPointer { source in
|
||||
items.withUnsafeBufferPointer { source in
|
||||
unsafe self.prepend(copying: source)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ extension RigidDeque /* where Element: Copyable */ {
|
||||
removing subrange: Range<Int>,
|
||||
copying items: Span<Element>
|
||||
) {
|
||||
unsafe items.withUnsafeBufferPointer { buffer in
|
||||
items.withUnsafeBufferPointer { buffer in
|
||||
unsafe self.replace(removing: subrange, copying: buffer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -368,7 +368,7 @@ extension UniqueDeque /* where Element: Copyable */ {
|
||||
public mutating func insert(
|
||||
copying items: Span<Element>, at index: Int
|
||||
) {
|
||||
unsafe items.withUnsafeBufferPointer {
|
||||
items.withUnsafeBufferPointer {
|
||||
unsafe self.insert(copying: $0, at: index)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ extension UniqueDeque /*where Element: Copyable*/ {
|
||||
@inlinable
|
||||
@_alwaysEmitIntoClient
|
||||
public mutating func prepend(copying items: Span<Element>) {
|
||||
unsafe items.withUnsafeBufferPointer { source in
|
||||
items.withUnsafeBufferPointer { source in
|
||||
unsafe self.prepend(copying: source)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -459,7 +459,7 @@ extension UniqueDeque /* where Element: Copyable */ {
|
||||
removing subrange: Range<Int>,
|
||||
copying items: Span<Element>
|
||||
) {
|
||||
unsafe items.withUnsafeBufferPointer { buffer in
|
||||
items.withUnsafeBufferPointer { buffer in
|
||||
unsafe self.replace(removing: subrange, copying: buffer)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class UniqueArrayTests: CollectionTestCase {
|
||||
|
||||
func test_init_capacity() {
|
||||
do {
|
||||
let a = UniqueArray<Int>(capacity: 0)
|
||||
let a = UniqueArray<Int>(minimumCapacity: 0)
|
||||
expectEqual(a.capacity, 0)
|
||||
expectEqual(a.count, 0)
|
||||
expectEqual(a.freeCapacity, 0)
|
||||
@@ -138,7 +138,7 @@ class UniqueArrayTests: CollectionTestCase {
|
||||
}
|
||||
|
||||
do {
|
||||
let a = UniqueArray<Int>(capacity: 10)
|
||||
let a = UniqueArray<Int>(minimumCapacity: 10)
|
||||
expectEqual(a.capacity, 10)
|
||||
expectEqual(a.count, 0)
|
||||
expectEqual(a.freeCapacity, 10)
|
||||
|
||||
@@ -108,7 +108,7 @@ final class MutableRefTests: CollectionTestCase {
|
||||
|
||||
func test_init_unsafeAddress_mutating() {
|
||||
var x = 789
|
||||
let pointer = unsafe withUnsafeMutablePointer(to: &x) { $0 }
|
||||
let pointer = withUnsafeMutablePointer(to: &x) { $0 }
|
||||
var ref = unsafe _MutableRef(unsafeAddress: pointer, mutating: &x)
|
||||
expectEqual(ref.value, 789)
|
||||
ref.value = 111
|
||||
@@ -119,7 +119,7 @@ final class MutableRefTests: CollectionTestCase {
|
||||
|
||||
func test_init_unsafeImmortalAddress() {
|
||||
var x = 555
|
||||
let pointer = unsafe withUnsafeMutablePointer(to: &x) { $0 }
|
||||
let pointer = withUnsafeMutablePointer(to: &x) { $0 }
|
||||
var ref = unsafe _MutableRef(unsafeImmortalAddress: pointer)
|
||||
expectEqual(ref.value, 555)
|
||||
ref.value = 666
|
||||
|
||||
@@ -71,7 +71,7 @@ final class RefTests: CollectionTestCase {
|
||||
@available(SwiftStdlib 6.4, *)
|
||||
func test_init_unsafeAddress_borrowing() {
|
||||
let x = 123
|
||||
unsafe withUnsafePointer(to: x) { pointer in
|
||||
withUnsafePointer(to: x) { pointer in
|
||||
let ref = Ref(unsafeAddress: pointer, borrowing: x)
|
||||
expectEqual(ref.value, 123)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user