Commit 50e2de45 authored by Rajko Albrecht's avatar Rajko Albrecht

Improved read_multi

parent 08012614
......@@ -88,9 +88,7 @@ class Redis
keys = keys.select {|k| exists(k)}
return {} if keys.empty?
values = mget(*(keys+[options]))
resulthash = {}
keys.zip(values) { |a,b| resulthash[a.to_s] = b} unless values.nil?
resulthash
values.nil? ? {} : Hash[keys.zip(values)]
end
private
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment