From: Dobrica Pavlinusic Date: Sat, 21 Mar 2009 23:39:20 +0000 (+0000) Subject: cleanup NX variants of commands X-Git-Tag: 0.0801~48 X-Git-Url: http://git.rot13.org/?p=perl-Redis.git;a=commitdiff_plain;h=96778b62304a7d787a721d6a5a56da60b7717c35 cleanup NX variants of commands git-svn-id: svn+ssh://llin/home/dpavlin/private/svn/Redis@15 447b33ff-793d-4489-8442-9bea7d161be5 --- diff --git a/lib/Redis.pm b/lib/Redis.pm index 2eabb7b..745d9ad 100644 --- a/lib/Redis.pm +++ b/lib/Redis.pm @@ -111,7 +111,7 @@ sub ping { sub set { my ( $self, $k, $v, $new ) = @_; - print $sock ( $new ? "SETNX" : "SET" ) . " $k " . length($v) . "\r\n$v\r\n"; + print $sock "SET" . ( $new ? 'NX' : '' ) . " $k " . length($v) . "\r\n$v\r\n"; _sock_ok(); } @@ -227,7 +227,7 @@ sub randomkey { =head2 rename - my $ok = $r->rename( 'old-key', 'new-key', $only_if_new ); + my $ok = $r->rename( 'old-key', 'new-key', $new ); =cut