Contents

swapAt(_:_:)

Exchanges the byte values at the specified indices in this buffer’s memory.

Declaration

func swapAt(_ i: Int, _ j: Int)

Parameters

  • i:

    The index of the first byte to swap.

  • j:

    The index of the second byte to swap.

Discussion

Both parameters must be valid indices of the buffer, and not equal to endIndex. Passing the same index as both i and j has no effect.