Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions stdlib/public/core/ArrayBufferProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ extension _ArrayBufferProtocol where Indices == Range<Int>{
// so as not to self-clobber.
newTailStart.moveInitialize(from: oldTailStart, count: tailCount)

// Assign over the original subrange
// Update the original subrange
var i = newValues.startIndex
for j in subrange {
elements[j] = newValues[i]
Expand Down Expand Up @@ -200,17 +200,17 @@ extension _ArrayBufferProtocol where Indices == Range<Int>{
let shrinkage = -growth
if tailCount > shrinkage { // If the tail length exceeds the shrinkage

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

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

// Destroy elements remaining after the tail in subrange
(newTailStart + tailCount).deinitialize(
Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/Bitset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ extension _UnsafeBitset {
@inlinable
@inline(__always)
internal func clear() {
words.assign(repeating: .empty, count: wordCount)
words.update(repeating: .empty, count: wordCount)
}
}

Expand Down
2 changes: 2 additions & 0 deletions stdlib/public/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ set(SWIFTLIB_SOURCES
SliceBuffer.swift
SIMDVector.swift
UnfoldSequence.swift
UnsafeBufferPointerSlice.swift
UnsafeBufferPointerProtocols.swift
VarArgs.swift
Zip.swift
"${SWIFT_SOURCE_DIR}/stdlib/linker-support/magic-symbols-for-install-name.c"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/public/core/GroupInfo.json
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@
"UnsafePointer.swift",
"UnsafeRawPointer.swift",
"UnsafeBufferPointer.swift",
"UnsafeBufferPointerSlice.swift",
"UnsafeBufferPointerProtocols.swift",
"UnsafeRawBufferPointer.swift"
],
"Protocols": [
Expand Down
4 changes: 2 additions & 2 deletions stdlib/public/core/HashTable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ extension _HashTable {
@_effects(releasenone)
internal func copyContents(of other: _HashTable) {
_internalInvariant(bucketCount == other.bucketCount)
self.words.assign(from: other.words, count: wordCount)
self.words.update(from: other.words, count: wordCount)
}

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

Expand Down
2 changes: 1 addition & 1 deletion stdlib/public/core/StringGuts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func _persistCString(_ p: UnsafePointer<CChar>?) -> [CChar]? {
guard let s = p else { return nil }
let bytesToCopy = UTF8._nullCodeUnitOffset(in: s) + 1 // +1 for the terminating NUL
let result = [CChar](unsafeUninitializedCapacity: bytesToCopy) { buf, initedCount in
buf.baseAddress!.assign(from: s, count: bytesToCopy)
buf.baseAddress!.update(from: s, count: bytesToCopy)
initedCount = bytesToCopy
}
return result
Expand Down
Loading