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

Method Insert

source/script.cpp:6940–6955  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6938
6939template<typename T, int INITIAL_SIZE>
6940ResultType ScriptItemList<T, INITIAL_SIZE>::Insert(T *aFunc, int aInsertPos)
6941{
6942 if (mCount == mCountMax)
6943 {
6944 // Allocate or expand function list.
6945 if (!Alloc(mCountMax ? mCountMax * 2 : INITIAL_SIZE))
6946 return FAIL;
6947 }
6948
6949 if (aInsertPos != mCount) // Need to make room at the indicated position for this variable.
6950 memmove(mItem + aInsertPos + 1, mItem + aInsertPos, (mCount - aInsertPos) * sizeof(Func *));
6951 //else both are zero or the item is being inserted at the end of the list, so it's easy.
6952 mItem[aInsertPos] = aFunc;
6953 ++mCount;
6954 return OK;
6955}
6956
6957
6958

Callers 6

ParseAndAddLineMethod · 0.45
AddFuncMethod · 0.45
AddVarMethod · 0.45
FindOrAddBuiltInVarMethod · 0.45
PreprocessLocalVarsMethod · 0.45
CreateHotFuncMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected