Something went wrong. Try again.
馃尡 A minimal programming language and compiler. git.urbach.dev/cli/q
high-performance programming-language compiler
Something went wrong. Try again.
12345678910111213141516package set
// BringToFront brings the element at `index` within the `slice` to the front.func BringToFront[T any](slice []T, index int) { if index <= 0 || index >= len(slice) { return }
target := slice[index]
for i := index; i > 0; i-- { slice[i] = slice[i-1] }
slice[0] = target}