예제 #1
0
 bool GetLRUElement(CacheEntry& value, bool remove)
 {
     if (m_cache_list.empty())
     {
         return false;
     }
     value = m_cache_list.back();
     if (remove)
     {
         m_entry_map.erase(value.first);
         m_cache_list.pop_back();
     }
     return true;
 }
예제 #2
0
파일: lru.hpp 프로젝트: kouhate/ardb
			bool GetLRUElement(value_type& value, bool remove)
			{
				if (m_cache_list.empty())
				{
					return false;
				}
				CacheEntry & entry = m_cache_list.back();
				value = entry.second;
				if (remove)
				{
					m_entry_map.erase(entry.first);
					m_cache_list.pop_back();
				}
				return true;
			}