MCPcopy Create free account
hub / github.com/Tencent/UnLua / Resize

Method Resize

Plugins/UnLua/Source/UnLua/Private/Containers/LuaArray.h:257–272  ·  view source on GitHub ↗

* Resize the array to new size * * @param NewSize - new size of the array */

Source from the content-addressed store, hash-verified

255 * @param NewSize - new size of the array
256 */
257 FORCEINLINE void Resize(int32 NewSize)
258 {
259 if (NewSize >= 0)
260 {
261 int32 Count = NewSize - Num();
262 if (Count > 0)
263 {
264 AddDefaulted(Count);
265 }
266 else if (Count < 0)
267 {
268 Destruct(NewSize, -Count);
269 ScriptArray->Remove(NewSize, -Count, ElementSize ALIGNMENT_PLACEHOLDER);
270 }
271 }
272 }
273
274 /**
275 * Get value of the i'th element

Callers 1

TArray_ResizeFunction · 0.45

Calls 2

NumFunction · 0.85
RemoveMethod · 0.45

Tested by

no test coverage detected