From 1f2a77373b08d86ad21c79b3e64b619bb9e4cbea Mon Sep 17 00:00:00 2001 From: "Mahlon E. Smith" Date: Fri, 23 Jun 2017 10:54:26 -0700 Subject: [PATCH] Don't mutate the caller's argument. --- lib/ezmlm/list.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ezmlm/list.rb b/lib/ezmlm/list.rb index 8d31d28..c045f24 100644 --- a/lib/ezmlm/list.rb +++ b/lib/ezmlm/list.rb @@ -70,7 +70,7 @@ class Ezmlm::List ### Returns +true+ if +address+ is a subscriber to this list. ### def include?( addr, section: nil ) - addr.downcase! + addr = addr.downcase file = self.subscription_dir( section ) + Ezmlm::Hash.subscriber( addr ) return false unless file.exist? return file.read.scan( /T([^\0]+)\0/ ).flatten.include?( addr ) @@ -91,7 +91,7 @@ class Ezmlm::List def subscribe( *addr, section: nil ) addr.each do |address| next unless address.index( '@' ) - address.downcase! + address = address.downcase file = self.subscription_dir( section ) + Ezmlm::Hash.subscriber( address ) self.with_safety do @@ -117,7 +117,7 @@ class Ezmlm::List ### def unsubscribe( *addr, section: nil ) addr.each do |address| - address.downcase! + address = address.downcase file = self.subscription_dir( section ) + Ezmlm::Hash.subscriber( address ) self.with_safety do