MCPcopy Index your code
hub / github.com/Shopify/go-lua / Swap

Method Swap

table.go:16–24  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

14func (h sortHelper) Len() int { return h.n }
15
16func (h sortHelper) Swap(i, j int) {
17 // Convert Go to Lua indices
18 i++
19 j++
20 h.l.RawGetInt(1, i)
21 h.l.RawGetInt(1, j)
22 h.l.RawSetInt(1, i)
23 h.l.RawSetInt(1, j)
24}
25
26func (h sortHelper) Less(i, j int) bool {
27 // Convert Go to Lua indices

Callers

nothing calls this directly

Calls 2

RawGetIntMethod · 0.80
RawSetIntMethod · 0.80

Tested by

no test coverage detected