]> git.saurik.com Git - redis.git/commitdiff
Redis-rb minor bool convertion fix
authorantirez <antirez@gmail.com>
Fri, 29 May 2009 10:52:21 +0000 (12:52 +0200)
committerantirez <antirez@gmail.com>
Fri, 29 May 2009 10:52:21 +0000 (12:52 +0200)
client-libraries/ruby/lib/redis.rb

index 28e304a6469a8ab974ee04e34044c237bd8b19a4..5c43bdd0d2570396aeb705c7337f8059f25d050a 100644 (file)
@@ -20,13 +20,7 @@ class Redis
         "echo"=>true, "getset"=>true, "smove"=>true
     }
 
         "echo"=>true, "getset"=>true, "smove"=>true
     }
 
-    ConvertToBool = lambda do |r| 
-      case r 
-        when 0 then false
-        when 1 then true
-        else r
-      end
-    end
+    ConvertToBool = lambda{|r| r == 0 ? false : r}
 
     ReplyProcessor = {
         "exists" => ConvertToBool,
 
     ReplyProcessor = {
         "exists" => ConvertToBool,