** Normalize an external string: If it is short, internalize it. */
| 342 | ** Normalize an external string: If it is short, internalize it. |
| 343 | */ |
| 344 | TString *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 |
no test coverage detected