Skip to content

Commit 2689b60

Browse files
authored
Merge pull request #41608 from glessard/se-pointer-family-initialization
2 parents 789e695 + 7f4caed commit 2689b60

14 files changed

+2642
-112
lines changed

stdlib/public/core/ArrayBufferProtocol.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ extension _ArrayBufferProtocol {
166166
// so as not to self-clobber.
167167
newTailStart.moveInitialize(from: oldTailStart, count: tailCount)
168168

169-
// Assign over the original subrange
169+
// Update the original subrange
170170
var i = newValues.startIndex
171171
for j in subrange {
172172
elements[j] = newValues[i]
@@ -199,17 +199,17 @@ extension _ArrayBufferProtocol {
199199
let shrinkage = -growth
200200
if tailCount > shrinkage { // If the tail length exceeds the shrinkage
201201

202-
// Assign over the rest of the replaced range with the first
202+
// Update the rest of the replaced range with the first
203203
// part of the tail.
204-
newTailStart.moveAssign(from: oldTailStart, count: shrinkage)
204+
newTailStart.moveUpdate(from: oldTailStart, count: shrinkage)
205205

206206
// Slide the rest of the tail back
207207
oldTailStart.moveInitialize(
208208
from: oldTailStart + shrinkage, count: tailCount - shrinkage)
209209
}
210210
else { // Tail fits within erased elements
211-
// Assign over the start of the replaced range with the tail
212-
newTailStart.moveAssign(from: oldTailStart, count: tailCount)
211+
// Update the start of the replaced range with the tail
212+
newTailStart.moveUpdate(from: oldTailStart, count: tailCount)
213213

214214
// Destroy elements remaining after the tail in subrange
215215
(newTailStart + tailCount).deinitialize(

stdlib/public/core/Bitset.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ extension _UnsafeBitset {
118118
@inlinable
119119
@inline(__always)
120120
internal func clear() {
121-
words.assign(repeating: .empty, count: wordCount)
121+
words.update(repeating: .empty, count: wordCount)
122122
}
123123
}
124124

stdlib/public/core/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ set(SWIFTLIB_SOURCES
227227
CommandLine.swift
228228
SliceBuffer.swift
229229
UnfoldSequence.swift
230+
UnsafeBufferPointerSlice.swift
230231
VarArgs.swift
231232
Zip.swift
232233
"${SWIFT_SOURCE_DIR}/stdlib/linker-support/magic-symbols-for-install-name.c"

stdlib/public/core/GroupInfo.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@
187187
"UnsafePointer.swift",
188188
"UnsafeRawPointer.swift",
189189
"UnsafeBufferPointer.swift",
190+
"UnsafeBufferPointerSlice.swift",
190191
"UnsafeRawBufferPointer.swift"
191192
],
192193
"Protocols": [

stdlib/public/core/HashTable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ extension _HashTable {
416416
@_effects(releasenone)
417417
internal func copyContents(of other: _HashTable) {
418418
_internalInvariant(bucketCount == other.bucketCount)
419-
self.words.assign(from: other.words, count: wordCount)
419+
self.words.update(from: other.words, count: wordCount)
420420
}
421421

422422
/// Insert a new entry with the specified hash value into the table.
@@ -446,7 +446,7 @@ extension _HashTable {
446446
// without a special case.
447447
words[0] = Word.allBits.subtracting(elementsBelow: bucketCount)
448448
} else {
449-
words.assign(repeating: .empty, count: wordCount)
449+
words.update(repeating: .empty, count: wordCount)
450450
}
451451
}
452452

stdlib/public/core/StringGuts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ public func _persistCString(_ p: UnsafePointer<CChar>?) -> [CChar]? {
432432
guard let s = p else { return nil }
433433
let bytesToCopy = UTF8._nullCodeUnitOffset(in: s) + 1 // +1 for the terminating NUL
434434
let result = [CChar](unsafeUninitializedCapacity: bytesToCopy) { buf, initedCount in
435-
buf.baseAddress!.assign(from: s, count: bytesToCopy)
435+
buf.baseAddress!.update(from: s, count: bytesToCopy)
436436
initedCount = bytesToCopy
437437
}
438438
return result

0 commit comments

Comments
 (0)