From f534ae435fea9c98641e9df2db4dc58dcc304d4e Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Wed, 16 Mar 2016 14:48:42 +0100 Subject: [PATCH] server: Do not modify hostname when printing The `<<` operator would modify the original hostname string for the server when calling Server#to_s. --- lib/memcached/server.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/memcached/server.rb b/lib/memcached/server.rb index 5624446..e7df369 100644 --- a/lib/memcached/server.rb +++ b/lib/memcached/server.rb @@ -11,7 +11,7 @@ module Memcached end def to_s - s = hostname + s = hostname.dup s << ":#{port}" if 0 != port s << ":#{weight}" if weight s