MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / reverse

Function reverse

3rd/lua-5.4.3/src/lapi.c:221–228  ·  view source on GitHub ↗

** Reverse the stack segment from 'from' to 'to' ** (auxiliary to 'lua_rotate') ** Note that we move(copy) only the value inside the stack. ** (We do not move additional fields that may exist.) */

Source from the content-addressed store, hash-verified

219** (We do not move additional fields that may exist.)
220*/
221static void reverse (lua_State *L, StkId from, StkId to) {
222 for (; from < to; from++, to--) {
223 TValue temp;
224 setobj(L, &temp, s2v(from));
225 setobjs2s(L, from, to);
226 setobj2s(L, to, &temp);
227 }
228}
229
230
231/*

Callers 4

write_numberMethod · 0.85
write_numberMethod · 0.85
CalculateOptimalEditsFunction · 0.85
lua_rotateFunction · 0.85

Calls

no outgoing calls

Tested by 1

CalculateOptimalEditsFunction · 0.68