diff options
author | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2015-11-01 01:13:18 +0100 |
---|---|---|
committer | jenkins4kodi <jenkins4kodi@users.noreply.github.com> | 2015-11-01 01:13:18 +0100 |
commit | 7a58dcb60dbb9acbdbf00cfb3c01014295e91747 (patch) | |
tree | ddda98cdb6fd1cabfd285a3bc721b519c0bfe676 | |
parent | e5f51772ecbfa9de3b6e27cd6b3c4de6cf030412 (diff) | |
parent | c3289bd1c89378b8a759b799559e8ef48c640f4a (diff) |
Merge pull request #8288 from arnova/up_dir_cache16.0a4-Jarvis
-rw-r--r-- | xbmc/filesystem/DirectoryCache.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/xbmc/filesystem/DirectoryCache.cpp b/xbmc/filesystem/DirectoryCache.cpp index a6dd061160..fe0fe898c9 100644 --- a/xbmc/filesystem/DirectoryCache.cpp +++ b/xbmc/filesystem/DirectoryCache.cpp @@ -28,6 +28,9 @@ #include <algorithm> +// Maximum number of directories to keep in our cache +#define MAX_CACHED_DIRS 50 + using namespace XFILE; CDirectoryCache::CDir::CDir(DIR_CACHE_TYPE cacheType) @@ -232,7 +235,6 @@ void CDirectoryCache::ClearCache(std::set<std::string>& dirs) void CDirectoryCache::CheckIfFull() { CSingleLock lock (m_cs); - static const unsigned int max_cached_dirs = 10; // find the last accessed folder, and remove if the number of cached folders is too many iCache lastAccessed = m_cache.end(); @@ -247,7 +249,7 @@ void CDirectoryCache::CheckIfFull() numCached++; } } - if (lastAccessed != m_cache.end() && numCached >= max_cached_dirs) + if (lastAccessed != m_cache.end() && numCached >= MAX_CACHED_DIRS) Delete(lastAccessed); } |