| 6938 | |
| 6939 | template<typename T, int INITIAL_SIZE> |
| 6940 | ResultType 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 |
no outgoing calls
no test coverage detected