Skip to content
Merged
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
6 changes: 6 additions & 0 deletions Sources/FoundationEssentials/Data/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1165,6 +1165,12 @@ public struct Data : Equatable, Hashable, RandomAccessCollection, MutableCollect
self.storage = storage
self.slice = RangeReference(0..<count)
}

// Not exposed as ABI and only usable by internal, non-inlined code and therefore not @inlinable
init(_ storage: __DataStorage, range: Range<Int>) {
self.storage = storage
self.slice = RangeReference(range)
}

@inlinable // This is @inlinable as trivially computable (and inlining may help avoid retain-release traffic).
mutating func ensureUniqueReference() {
Expand Down