ole32: Use the cached information in BlockChainStream_GetCount.

This commit is contained in:
Vincent Povirk 2010-05-06 11:35:56 -05:00 committed by Alexandre Julliard
parent 96a939eee1
commit 4ad114cfae
1 changed files with 1 additions and 19 deletions

View File

@ -5786,28 +5786,10 @@ static ULONG BlockChainStream_GetHeadOfChain(BlockChainStream* This)
* *
* Returns the number of blocks that comprises this chain. * Returns the number of blocks that comprises this chain.
* This is not the size of the stream as the last block may not be full! * This is not the size of the stream as the last block may not be full!
*
* FIXME: Use the cache to get this information.
*/ */
static ULONG BlockChainStream_GetCount(BlockChainStream* This) static ULONG BlockChainStream_GetCount(BlockChainStream* This)
{ {
ULONG blockIndex; return This->numBlocks;
ULONG count = 0;
blockIndex = BlockChainStream_GetHeadOfChain(This);
while (blockIndex != BLOCK_END_OF_CHAIN)
{
count++;
if(FAILED(StorageImpl_GetNextBlockInChain(
This->parentStorage,
blockIndex,
&blockIndex)))
return 0;
}
return count;
} }
/****************************************************************************** /******************************************************************************