File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -374,10 +374,35 @@ extension InlineArray where Element: ~Copyable {
374374
375375 @_transparent
376376 unsafeMutableAddress {
377- _checkIndex ( i)
377+ _checkIndex ( i)
378378 return unsafe _mutableAddress + i
379379 }
380380 }
381+
382+ /// Accesses the element at the specified position.
383+ ///
384+ /// - Warning: This subscript trades safety for performance. Using an invalid
385+ /// index results in undefined behavior.
386+ ///
387+ /// - Parameter i: The position of the element to access. `i` must be a valid
388+ /// index of the array that is not equal to the `endIndex` property.
389+ ///
390+ /// - Complexity: O(1)
391+ @available ( SwiftStdlib 6 . 2 , * )
392+ @_addressableSelf
393+ @_alwaysEmitIntoClient
394+ @unsafe
395+ public subscript( unchecked i: Index ) -> Element {
396+ @_transparent
397+ unsafeAddress {
398+ unsafe _address + i
399+ }
400+
401+ @_transparent
402+ unsafeMutableAddress {
403+ unsafe _mutableAddress + i
404+ }
405+ }
381406}
382407
383408//===----------------------------------------------------------------------===//
You can’t perform that action at this time.
0 commit comments