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

Method Less

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

Source from the content-addressed store, hash-verified

24}
25
26func (h sortHelper) Less(i, j int) bool {
27 // Convert Go to Lua indices
28 i++
29 j++
30 if h.hasFunction {
31 h.l.PushValue(2)
32 h.l.RawGetInt(1, i)
33 h.l.RawGetInt(1, j)
34 h.l.Call(2, 1)
35 b := h.l.ToBoolean(-1)
36 h.l.Pop(1)
37 return b
38 }
39 h.l.RawGetInt(1, i)
40 h.l.RawGetInt(1, j)
41 b := h.l.Compare(-2, -1, OpLT)
42 h.l.Pop(2)
43 return b
44}
45
46var tableLibrary = []RegistryFunction{
47 {"concat", func(l *State) int {

Callers 1

table.goFile · 0.80

Calls 6

PushValueMethod · 0.80
RawGetIntMethod · 0.80
CallMethod · 0.80
ToBooleanMethod · 0.80
PopMethod · 0.80
CompareMethod · 0.80

Tested by

no test coverage detected