Check this to see whether a new item-count is needed. If this does not equal the given itemCount, then the data needs to be transferred into a new list using transferData
| 268 | ///Check this to see whether a new item-count is needed. If this does not equal the given itemCount, then |
| 269 | ///the data needs to be transferred into a new list using transferData |
| 270 | uint newItemCount() const |
| 271 | { |
| 272 | if (!m_applied) { |
| 273 | if (*m_centralFreeItem == -1) { |
| 274 | uint realItemCount = m_itemCount - countFreeItems(*m_centralFreeItem); |
| 275 | uint newItemCount = realItemCount + (realItemCount / increaseFraction); |
| 276 | if (newItemCount <= m_itemCount) |
| 277 | newItemCount = m_itemCount + 1; |
| 278 | |
| 279 | return newItemCount; |
| 280 | } else if (m_needResize) { |
| 281 | uint realItemCount = m_itemCount - countFreeItems(*m_centralFreeItem); |
| 282 | uint newItemCount = realItemCount + (realItemCount / increaseFraction); |
| 283 | |
| 284 | return newItemCount; |
| 285 | } |
| 286 | } |
| 287 | return m_itemCount; |
| 288 | } |
| 289 | |
| 290 | ///Transfers the data into a new item-list. The size of the new item-list must equal newItemCount() |
| 291 | void transferData(Data* newItems, uint newCount, int* newCentralFree = nullptr) |
no outgoing calls