diff options
Diffstat (limited to 'include/utils/GenerationCache.h')
-rw-r--r-- | include/utils/GenerationCache.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h index 83cda8689fd1..da85a9aebbb1 100644 --- a/include/utils/GenerationCache.h +++ b/include/utils/GenerationCache.h @@ -88,11 +88,13 @@ private: void attachToCache(const sp<Entry<K, V> >& entry); void detachFromCache(const sp<Entry<K, V> >& entry); + + const V mNullValue; }; // class GenerationCache template<typename K, typename V> GenerationCache<K, V>::GenerationCache(uint32_t maxCapacity): mMaxCapacity(maxCapacity), - mListener(NULL) { + mListener(NULL), mNullValue(NULL) { }; template<typename K, typename V> @@ -154,7 +156,7 @@ const V& GenerationCache<K, V>::get(const K& key) { return entry->value; } - return NULL; + return mNullValue; } template<typename K, typename V> |