MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / str_reverse

Function str_reverse

src/Chain/libraries/glua/lstrlib.cpp:83–92  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81
82
83static int str_reverse(lua_State *L) {
84 size_t l, i;
85 luaL_Buffer b;
86 const char *s = luaL_checklstring(L, 1, &l);
87 char *p = luaL_buffinitsize(L, &b, l);
88 for (i = 0; i < l; i++)
89 p[i] = s[l - i - 1];
90 luaL_pushresultsize(&b, l);
91 return 1;
92}
93
94
95static int str_lower(lua_State *L) {

Callers

nothing calls this directly

Calls 3

luaL_checklstringFunction · 0.85
luaL_buffinitsizeFunction · 0.85
luaL_pushresultsizeFunction · 0.85

Tested by

no test coverage detected