| 2579 | } |
| 2580 | |
| 2581 | void StreamIndexedIO::Index::deallocateWalk( NodeBase* n ) |
| 2582 | { |
| 2583 | assert(n); |
| 2584 | |
| 2585 | // store the pointer for future deallocation |
| 2586 | m_removedNodes.push_back( n ); |
| 2587 | |
| 2588 | if ( n->nodeType() == NodeBase::Directory ) |
| 2589 | { |
| 2590 | DirectoryNode *nn = static_cast< DirectoryNode *>(n); |
| 2591 | |
| 2592 | for (DirectoryNode::ChildMap::const_iterator it = nn->children().begin(); it != nn->children().end(); ++it) |
| 2593 | { |
| 2594 | deallocateWalk( *it ); |
| 2595 | } |
| 2596 | |
| 2597 | nn->children().clear(); |
| 2598 | } |
| 2599 | else |
| 2600 | { |
| 2601 | // We don't deallocate data node blocks because they could be referred by other nodes. |
| 2602 | // As a result, editing files will usually increase file size. |
| 2603 | } |
| 2604 | |
| 2605 | } |
| 2606 | |
| 2607 | void StreamIndexedIO::Index::commitNodeToSubIndex( DirectoryNode *n ) |
| 2608 | { |
no test coverage detected