             slice = HalfInt(range.lowerBound)..<HalfInt(range.upperBound)
         }
 
-        @inlinable
+        @inlinable // This is @inlinable as trivially computable (and inlining may help avoid retain-release traffic).
         mutating func ensureUniqueReference() {
             if !isKnownUniquelyReferenced(&storage) {
                 storage = storage.mutableCopy(self.range)
             }
         }
 
-        @inlinable
-        var startIndex: Int { return numericCast(slice.lowerBound) }
-        @inlinable
-        var endIndex: Int { return numericCast(slice.upperBound) }
-
-        @inlinable
+        @inlinable // This is @inlinable as trivially computable.
+        var startIndex: Int {
+            return Int(slice.lowerBound)
+        }
+
+        @inlinable // This is @inlinable as trivially computable.
+        var endIndex: Int {
+            return Int(slice.upperBound)
+        }
+
+        @inlinable // This is @inlinable as trivially computable.
         var capacity: Int {
             return storage.capacity
         }
 
-        @inlinable
+        @inlinable // This is @inlinable as trivially computable (and inlining may help avoid retain-release traffic).
         mutating func reserveCapacity(_ minimumCapacity: Int) {
             ensureUniqueReference()
             // the current capacity can be zero (representing externally owned buffer), and count can be greater than the capacity
             storage.ensureUniqueBufferReference(growingTo: Swift.max(minimumCapacity, count))
         }
 
-        @inlinable
+        @inlinable // This is @inlinable as trivially computable.
         var count: Int {
             get {
-                return numericCast(slice.upperBound - slice.lowerBound)
+                return Int(slice.upperBound - slice.lowerBound)
             }
             set(newValue) {
                 assert(newValue < HalfInt.max)

    }

#if arch(x86_64) || arch(arm64) || arch(s390x) || arch(powerpc64) || arch(powerpc64le)
    @usableFromInline
    internal typealias HalfInt = Int32
#elseif arch(i386) || arch(arm)
    @usableFromInline
    internal typealias HalfInt = Int16
#endif

    @usableFromInline
    @_fixed_layout
    internal struct InlineSlice {
        // ***WARNING***
        // These ivars are specifically laid out so that they cause the enum _Representation to be 16 bytes on 64 bit platforms. This means we _MUST_ have the class type thing last
        @usableFromInline
        var slice: Range<HalfInt>
        @usableFromInline
        var storage: _DataStorage

        @inlinable
        static func canStore(count: Int) -> Bool {
            return count < HalfInt.max
        }

        @inlinable
        init(_ buffer: UnsafeRawBufferPointer) {
            assert(buffer.count < HalfInt.max)
            self.init(_DataStorage(bytes: buffer.baseAddress, length: buffer.count), count: buffer.count)
        }

        @inlinable
        init(capacity: Int) {
            assert(capacity < HalfInt.max)
            self.init(_DataStorage(capacity: capacity), count: 0)
        }

        @inlinable
        init(count: Int) {
            assert(count < HalfInt.max)
            self.init(_DataStorage(length: count), count: count)
        }

        @inlinable
        init(_ inline: InlineData) {
            assert(inline.count < HalfInt.max)
            self.init(inline.withUnsafeBytes { return _DataStorage(bytes: $0.baseAddress, length: $0.count) }, count: inline.count)
        }

        @inlinable
        init(_ inline: InlineData, range: Range<Int>) {
            assert(range.lowerBound < HalfInt.max)
            assert(range.upperBound < HalfInt.max)
            self.init(inline.withUnsafeBytes { return _DataStorage(bytes: $0.baseAddress, length: $0.count) }, range: range)
        }

        @inlinable
        init(_ large: LargeSlice) {
            assert(large.range.lowerBound < HalfInt.max)
            assert(large.range.upperBound < HalfInt.max)
            self.init(large.storage, range: large.range)
        }

        @inlinable
        init(_ large: LargeSlice, range: Range<Int>) {
            assert(range.lowerBound < HalfInt.max)
            assert(range.upperBound < HalfInt.max)
            self.init(large.storage, range: range)
        }

        @inlinable
        init(_ storage: _DataStorage, count: Int) {
            assert(count < HalfInt.max)
            self.storage = storage
            slice = 0..<HalfInt(count)
        }

        @inlinable
        init(_ storage: _DataStorage, range: Range<Int>) {
            assert(range.lowerBound < HalfInt.max)
            assert(range.upperBound < HalfInt.max)

            }
        }

        @inlinable // This is @inlinable as reasonably small.
        mutating func replaceSubrange(_ subrange: Range<Index>, with bytes: UnsafeRawPointer?, count cnt: Int) {
            precondition(startIndex <= subrange.lowerBound, "index \(subrange.lowerBound) is out of bounds of \(startIndex)..<\(endIndex)")
            precondition(subrange.lowerBound <= endIndex, "index \(subrange.lowerBound) is out of bounds of \(startIndex)..<\(endIndex)")
