Skip to content

Commit 7a58dcb

Browse files
committed
Merge pull request xbmc#8288 from arnova/up_dir_cache
2 parents e5f5177 + c3289bd commit 7a58dcb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

xbmc/filesystem/DirectoryCache.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@
2828

2929
#include <algorithm>
3030

31+
// Maximum number of directories to keep in our cache
32+
#define MAX_CACHED_DIRS 50
33+
3134
using namespace XFILE;
3235

3336
CDirectoryCache::CDir::CDir(DIR_CACHE_TYPE cacheType)
@@ -232,7 +235,6 @@ void CDirectoryCache::ClearCache(std::set<std::string>& dirs)
232235
void CDirectoryCache::CheckIfFull()
233236
{
234237
CSingleLock lock (m_cs);
235-
static const unsigned int max_cached_dirs = 10;
236238

237239
// find the last accessed folder, and remove if the number of cached folders is too many
238240
iCache lastAccessed = m_cache.end();
@@ -247,7 +249,7 @@ void CDirectoryCache::CheckIfFull()
247249
numCached++;
248250
}
249251
}
250-
if (lastAccessed != m_cache.end() && numCached >= max_cached_dirs)
252+
if (lastAccessed != m_cache.end() && numCached >= MAX_CACHED_DIRS)
251253
Delete(lastAccessed);
252254
}
253255

0 commit comments

Comments
 (0)