MCPcopy Create free account
hub / github.com/KDE/kdevelop / newItemCount

Method newItemCount

kdevplatform/util/embeddedfreetree.h:270–288  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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)

Callers 8

addDeclarationMethod · 0.45
removeDeclarationMethod · 0.45
addItemMethod · 0.45
removeItemMethod · 0.45
insertMethod · 0.45
removeMethod · 0.45
insertMethod · 0.45
removeMethod · 0.45

Calls

no outgoing calls

Tested by 2

insertMethod · 0.36
removeMethod · 0.36