package reflect
import (
)
func ( interface{}) func(, int) {
:= ValueOf()
if .Kind() != Slice {
panic(&ValueError{Method: "Swapper", Kind: .Kind()})
}
switch .Len() {
case 0:
return func(, int) { panic("reflect: slice index out of range") }
case 1:
return func(, int) {
if != 0 || != 0 {
panic("reflect: slice index out of range")
}
}
}
:= .Type().Elem().(*rtype)
:= .Size()
:= .ptrdata != 0
if {
if == ptrSize {
:= *(*[]unsafe.Pointer)(.ptr)
return func(, int) { [], [] = [], [] }
}
if .Kind() == String {
:= *(*[]string)(.ptr)
return func(, int) { [], [] = [], [] }
}
} else {
switch {
case 8:
:= *(*[]int64)(.ptr)
return func(, int) { [], [] = [], [] }
case 4:
:= *(*[]int32)(.ptr)
return func(, int) { [], [] = [], [] }
case 2:
:= *(*[]int16)(.ptr)
return func(, int) { [], [] = [], [] }
case 1:
:= *(*[]int8)(.ptr)
return func(, int) { [], [] = [], [] }
}
}
:= (*unsafeheader.Slice)(.ptr)
:= unsafe_New()
return func(, int) {
if uint() >= uint(.Len) || uint() >= uint(.Len) {
panic("reflect: slice index out of range")
}
:= arrayAt(.Data, , , "i < s.Len")
:= arrayAt(.Data, , , "j < s.Len")
typedmemmove(, , )
typedmemmove(, , )
typedmemmove(, , )
}
}