From 758b6d4c272c8132fd9090022b8b84a394062b91 Mon Sep 17 00:00:00 2001 From: antirez Date: Fri, 14 May 2010 16:41:24 +0200 Subject: [PATCH] use DEBUG DIGEST in the test instead of a function that was doing a similar work, but in a much slower and buggy way --- test-redis.tcl | 40 +--------------------------------------- 1 file changed, 1 insertion(+), 39 deletions(-) diff --git a/test-redis.tcl b/test-redis.tcl index a3ced320..3b5900f9 100644 --- a/test-redis.tcl +++ b/test-redis.tcl @@ -191,45 +191,7 @@ proc createComplexDataset {r ops} { } proc datasetDigest r { - set keys [lsort [$r keys *]] - set digest {} - foreach k $keys { - set t [$r type $k] - switch $t { - {string} { - set aux [::sha1::sha1 -hex [$r get $k]] - } {list} { - if {[$r llen $k] == 0} { - set aux {} - } else { - set aux [::sha1::sha1 -hex [$r lrange $k 0 -1]] - } - } {set} { - if {[$r scard $k] == 0} { - set aux {} - } else { - set aux [::sha1::sha1 -hex [lsort [$r smembers $k]]] - } - } {zset} { - if {[$r zcard $k] == 0} { - set aux {} - } else { - set aux [::sha1::sha1 -hex [$r zrange $k 0 -1 withscores]] - } - } {hash} { - if {[$r hlen $k] == 0} { - set aux {} - } else { - set aux [::sha1::sha1 -hex [lsort [$r hgetall $k]]] - } - } default { - error "Type not supported: $t" - } - } - if {$aux eq {}} continue - set digest [::sha1::sha1 -hex [join [list $aux $digest $k] "\n"]] - } - return $digest + $r debug digest } proc main {} {