simplify
This commit is contained in:
@@ -244,24 +244,23 @@ FileSet *FilenameDB::GetFileSet( CString dir, bool create )
|
|||||||
return i->second;
|
return i->second;
|
||||||
}
|
}
|
||||||
|
|
||||||
FileSet *ret;
|
|
||||||
if( i != dirs.end() )
|
if( i != dirs.end() )
|
||||||
{
|
{
|
||||||
if( ExpireSeconds != -1 && i->second->age.PeekDeltaTime() >= ExpireSeconds )
|
if( ExpireSeconds == -1 || i->second->age.PeekDeltaTime() < ExpireSeconds )
|
||||||
{
|
{
|
||||||
ret = i->second;
|
/* Found it, and it hasn't expired. */
|
||||||
ret->age.Touch();
|
|
||||||
ret->files.clear();
|
|
||||||
} else
|
|
||||||
return i->second;
|
return i->second;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
delete i->second;
|
||||||
ret = new FileSet;
|
dirs.erase( i );
|
||||||
AddFileSet( dir, ret );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileSet *ret = new FileSet;
|
||||||
PopulateFileSet( *ret, dir );
|
PopulateFileSet( *ret, dir );
|
||||||
|
|
||||||
|
AddFileSet( dir, ret );
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user