Skip to content

Commit

Permalink
Fix encoding parameter to new():
Browse files Browse the repository at this point in the history
When new(encoding => undef) was called, to disable the automatic
encode/decode step, we actually defaulted to 'utf8', causing massive
performance degradation.

Signed-off-by: Pedro Melo <melo@simplicidade.org>
  • Loading branch information
melo committed Oct 8, 2010
1 parent 91693e7 commit 7f8e6e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Redis.pm
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ sub new {
my $self = {@_};

$self->{debug} ||= $ENV{REDIS_DEBUG};
$self->{encoding} ||= 'utf8'; ## default to lax utf8
$self->{encoding} = 'utf8'
unless exists $self->{encoding}; ## default to lax utf8

$self->{server} ||= $ENV{REDIS_SERVER} || '127.0.0.1:6379';
$self->{sock} = IO::Socket::INET->new(
Expand Down

0 comments on commit 7f8e6e5

Please sign in to comment.