ole32: Use the cached information in BlockChainStream_GetCount.
This commit is contained in:
parent
96a939eee1
commit
4ad114cfae
|
@ -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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue