From 30f36ffc1caefb8d677a62702a13aefd1567d373 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Thu, 6 May 2010 11:35:56 -0500 Subject: [PATCH 1/2] ole32: Use the cached information in BlockChainStream_GetCount. --- dlls/ole32/storage32.c | 20 +------------------- 1 files changed, 1 insertions(+), 19 deletions(-) diff --git a/dlls/ole32/storage32.c b/dlls/ole32/storage32.c index 8bae897..9ac794e 100644 --- a/dlls/ole32/storage32.c +++ b/dlls/ole32/storage32.c @@ -5786,28 +5786,10 @@ static ULONG BlockChainStream_GetHeadOfChain(BlockChainStream* This) * * 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! - * - * FIXME: Use the cache to get this information. */ static ULONG BlockChainStream_GetCount(BlockChainStream* This) { - ULONG blockIndex; - 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; + return This->numBlocks; } /****************************************************************************** -- 1.6.3.3