 internal func _decodeScalar(
   _ utf16: UnsafeBufferPointer<UInt16>, startingAt i: Int
 ) -> (Unicode.Scalar, scalarLength: Int) {
-  let high = utf16[i]
+  let high = utf16[_unchecked: i]
   if i + 1 >= utf16.count {
     _internalInvariant(!UTF16.isLeadSurrogate(high))
     _internalInvariant(!UTF16.isTrailSurrogate(high))

  @inlinable
  internal func fastUTF8ScalarLength(startingAt i: Int) -> Int {
    _internalInvariant(isFastUTF8)
    let len = _utf8ScalarLength(self.withFastUTF8 { $0[i] })
    _internalInvariant((1...4) ~= len)
    return len
  }

    return (Unicode.Scalar(_unchecked: UInt32(high)), 1)
  }

  let low = utf16[_unchecked: i+1]
  _internalInvariant(UTF16.isLeadSurrogate(high))
  _internalInvariant(UTF16.isTrailSurrogate(low))
  return (UTF16._decodeSurrogates(high, low), 2)
