From 78ed574935efda1f7679824efe66e043fb0e80d3 Mon Sep 17 00:00:00 2001 From: Jeremy Schonfeld Date: Fri, 7 Nov 2025 15:13:41 -0800 Subject: [PATCH] Resolve a few Data warnings --- Sources/FoundationEssentials/Data/DataProtocol.swift | 4 +++- .../Data/Representations/Data+LargeSlice.swift | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) 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,