Skip to content

Commit

Permalink
LumpDirectory: Don't count duplicates in the pruneFile() total
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Oct 3, 2012
1 parent 7535fdc commit fab7c1b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions doomsday/engine/portable/src/lumpdirectory.cpp
Expand Up @@ -106,7 +106,7 @@ struct LumpDirectory::Instance

/**
* @param pruneFlags Passed by reference to avoid deep copy on value-write.
* @return Number of lumps flagged during this op.
* @return Number of lumps newly flagged during this op.
*/
int flagFileLumps(QBitArray& pruneFlags, AbstractFile& file)
{
Expand All @@ -116,6 +116,7 @@ struct LumpDirectory::Instance
int numFlagged = 0;
for(int i = 0; i < numRecords; ++i)
{
if(pruneFlags.testBit(i)) continue;
if(reinterpret_cast<de::AbstractFile*>(lumpInfos[i]->container) != &file) continue;
pruneFlags.setBit(i, true);
numFlagged += 1;
Expand Down Expand Up @@ -147,7 +148,7 @@ struct LumpDirectory::Instance

/**
* @param pruneFlags Passed by reference to avoid deep copy on value-write.
* @return Number of lumps flagged during this op.
* @return Number of lumps newly flagged during this op.
*/
int flagDuplicateLumps(QBitArray& pruneFlags)
{
Expand Down Expand Up @@ -178,6 +179,7 @@ struct LumpDirectory::Instance
int numFlagged = 0;
for(int i = 1; i < numRecords; ++i)
{
if(pruneFlags.testBit(i)) continue;
if(Str_CompareIgnoreCase(sortInfos[i - 1].path, Str_Text(sortInfos[i].path))) continue;
pruneFlags.setBit(sortInfos[i].origIndex, true);
numFlagged += 1;
Expand Down

0 comments on commit fab7c1b

Please sign in to comment.