MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / SetLength

Method SetLength

source/script_object.cpp:1845–1860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1843}
1844
1845ResultType Array::SetLength(index_t aNewLength)
1846{
1847 if (mLength > aNewLength)
1848 {
1849 RemoveAt(aNewLength, mLength - aNewLength);
1850 return OK;
1851 }
1852 if (aNewLength > mCapacity && !SetCapacity(aNewLength))
1853 return FAIL;
1854 for (index_t i = mLength; i < aNewLength; ++i)
1855 {
1856 mItem[i].Minit();
1857 }
1858 mLength = aNewLength;
1859 return OK;
1860}
1861
1862Array::~Array()
1863{

Callers

nothing calls this directly

Calls 2

SetCapacityFunction · 0.85
MinitMethod · 0.80

Tested by

no test coverage detected