| 788 | } |
| 789 | |
| 790 | static void copy_table(lua_State *state, int dest, int src, int skipbase) |
| 791 | { |
| 792 | // stack: (skipbase) skipkey skipkey | |
| 793 | |
| 794 | int top = lua_gettop(state); |
| 795 | |
| 796 | lua_pushnil(state); |
| 797 | |
| 798 | while (lua_next(state, src)) |
| 799 | { |
| 800 | for (int i = skipbase+1; i <= top; i++) |
| 801 | { |
| 802 | if (lua_rawequal(state, -2, i)) |
| 803 | { |
| 804 | lua_pop(state, 1); |
| 805 | goto next_outer; |
| 806 | } |
| 807 | } |
| 808 | |
| 809 | { |
| 810 | lua_pushvalue(state, -2); |
| 811 | lua_swap(state); |
| 812 | lua_settable(state, dest); |
| 813 | } |
| 814 | |
| 815 | next_outer:; |
| 816 | } |
| 817 | } |
| 818 | |
| 819 | /** |
| 820 | * Method: assign data between objects. |
no test coverage detected