]> git.saurik.com Git - redis.git/blobdiff - dict.c
code to compare strings with entries in ziplist, regardless of their encoding
[redis.git] / dict.c
diff --git a/dict.c b/dict.c
index 08bffbff8e44cf631c71883cd5057148f6c5cfe1..d5010708c37ce6729e3068a170e30029f2fa1d38 100644 (file)
--- a/dict.c
+++ b/dict.c
@@ -423,6 +423,13 @@ dictEntry *dictFind(dict *d, const void *key)
     return NULL;
 }
 
+void *dictFetchValue(dict *d, const void *key) {
+    dictEntry *he;
+
+    he = dictFind(d,key);
+    return he ? dictGetEntryVal(he) : NULL;
+}
+
 dictIterator *dictGetIterator(dict *d)
 {
     dictIterator *iter = _dictAlloc(sizeof(*iter));