** Normalize an external string: If it is short, internalize it. */
| 343 | ** Normalize an external string: If it is short, internalize it. |
| 344 | */ |
| 345 | TString *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 | |
| 356 | char *plutoS_prealloc (lua_State *L, char shrtbuf[LUAI_MAXSHORTLEN], size_t l) { |
no test coverage detected