MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / luaS_normstr

Function luaS_normstr

src/lstring.cpp:345–353  ·  view source on GitHub ↗

** Normalize an external string: If it is short, internalize it. */

Source from the content-addressed store, hash-verified

343** Normalize an external string: If it is short, internalize it.
344*/
345TString *luaS_normstr (lua_State *L, TString *ts) {
346 size_t len = ts->u.lnglen;
347 if (len > LUAI_MAXSHORTLEN)
348 return ts; /* long string; keep the original */
349 else {
350 const char *str = getlngstr(ts);
351 return internshrstr(L, str, len);
352 }
353}
354
355
356char *plutoS_prealloc (lua_State *L, char shrtbuf[LUAI_MAXSHORTLEN], size_t l) {

Callers 1

luaH_finishsetFunction · 0.85

Calls 1

internshrstrFunction · 0.85

Tested by

no test coverage detected