** Load a nullable string. */
| 108 | ** Load a nullable string. |
| 109 | */ |
| 110 | static TString *loadStringN (LoadState *S) { |
| 111 | size_t size = loadSize(S); |
| 112 | if (size == 0) |
| 113 | return NULL; |
| 114 | else if (--size <= LUAI_MAXSHORTLEN) { /* short string? */ |
| 115 | char buff[LUAI_MAXSHORTLEN]; |
| 116 | loadVector(S, buff, size); |
| 117 | return luaS_newlstr(S->L, buff, size); |
| 118 | } |
| 119 | else { /* long string */ |
| 120 | TString *ts = luaS_createlngstrobj(S->L, size); |
| 121 | loadVector(S, getstr(ts), size); /* load directly in final place */ |
| 122 | return ts; |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | |
| 127 | /* |
no test coverage detected