summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2011-12-08 18:51:03 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-12-08 18:51:03 -0800
commitd3209c1bb21ce026d4e41464740e3d8f57cdd56f (patch)
tree1eebbf03a13b6ded6aa55537d76a33a7a5a5f26e
parent66b2ff818bdc58465e54d7fc42772857c07fa262 (diff)
parent46b9f7cc2047ac16ecf36ffb6c6d3def0a5f5ccb (diff)
downloadframeworks_base-d3209c1bb21ce026d4e41464740e3d8f57cdd56f.zip
frameworks_base-d3209c1bb21ce026d4e41464740e3d8f57cdd56f.tar.gz
frameworks_base-d3209c1bb21ce026d4e41464740e3d8f57cdd56f.tar.bz2
Merge "GenerationCache::get would return a random value instead of NULL Bug #5401917"
-rw-r--r--include/utils/GenerationCache.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/include/utils/GenerationCache.h b/include/utils/GenerationCache.h
index 83cda86..da85a9a 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>