Skip to content

Commit

Permalink
Check for Ruby 1.9 as early as possible.
Browse files Browse the repository at this point in the history
  • Loading branch information
djanowski committed Apr 8, 2010
1 parent 5ead248 commit 9e43fde
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/redis/client.rb
Expand Up @@ -475,8 +475,14 @@ def read_reply
end


def get_size(string)
string.respond_to?(:bytesize) ? string.bytesize : string.size
if "".respond_to?(:bytesize)
def get_size(string)
string.bytesize
end
else
def get_size(string)
string.size
end
end

private
Expand Down

0 comments on commit 9e43fde

Please sign in to comment.