MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaS_normstr

Function luaS_normstr

third-party/lua-5.5.0/src/lstring.c:344–352  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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

Callers 1

luaH_finishsetFunction · 0.85

Calls 1

internshrstrFunction · 0.70

Tested by

no test coverage detected