diff --git a/Sources/FoundationEssentials/Data/DataProtocol.swift b/Sources/FoundationEssentials/Data/DataProtocol.swift index 1b9dfe3e4..ac192d28c 100644 --- a/Sources/FoundationEssentials/Data/DataProtocol.swift +++ b/Sources/FoundationEssentials/Data/DataProtocol.swift @@ -239,7 +239,9 @@ extension Data : MutableDataProtocol { public var regions: CollectionOfOne { return CollectionOfOne(self) } - +} + +extension Data { /// Copy the contents of the data to a pointer. /// /// - parameter pointer: A pointer to the buffer you wish to copy the bytes into. diff --git a/Sources/FoundationEssentials/Data/Representations/Data+LargeSlice.swift b/Sources/FoundationEssentials/Data/Representations/Data+LargeSlice.swift index 82fcf31bc..2974d2921 100644 --- a/Sources/FoundationEssentials/Data/Representations/Data+LargeSlice.swift +++ b/Sources/FoundationEssentials/Data/Representations/Data+LargeSlice.swift @@ -159,7 +159,6 @@ extension Data { @inlinable // This is @inlinable as reasonably small. mutating func append(contentsOf buffer: UnsafeRawBufferPointer) { ensureUniqueReference() - let upperbound = storage.length + storage._offset storage.replaceBytes( in: ( location: range.upperBound,