mirror of
https://github.com/apple/swift-collections
synced 2026-11-30 05:18:44 +00:00
remove workarounds
This commit is contained in:
1 parent
ffebc71d54
commit
c8fc80381e
1 file changed
+2
-2
@@ -485,7 +485,7 @@ extension Span where Element: ~Copyable {
|
||||
@_alwaysEmitIntoClient
|
||||
public subscript(unchecked position: Int) -> Element {
|
||||
_read {
|
||||
let element = UnsafeRawPointer(_start).advanced(by: position&*MemoryLayout<Element>.stride)
|
||||
let element = _start.advanced(by: position&*MemoryLayout<Element>.stride)
|
||||
let binding = Builtin.bindMemory(element._rawValue, count._builtinWordValue, Element.self)
|
||||
defer { Builtin.rebindMemory(element._rawValue, binding) }
|
||||
yield UnsafePointer<Element>(element._rawValue).pointee
|
||||
@@ -522,7 +522,7 @@ extension Span where Element: BitwiseCopyable {
|
||||
@_alwaysEmitIntoClient
|
||||
public subscript(unchecked position: Int) -> Element {
|
||||
get {
|
||||
let address = UnsafeRawPointer(_start).advanced(by: position&*MemoryLayout<Element>.stride)
|
||||
let address = _start.advanced(by: position&*MemoryLayout<Element>.stride)
|
||||
return address.loadUnaligned(as: Element.self)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user