(i, j int)
| 24 | } |
| 25 | |
| 26 | func (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 | |
| 46 | var tableLibrary = []RegistryFunction{ |
| 47 | {"concat", func(l *State) int { |