Don't mutate the caller's argument.
authorMahlon E. Smith <mahlon@martini.nu>
Fri, 23 Jun 2017 10:54:26 -0700
changeset 26 a89d91d4b157
parent 25 81cc7d47f68f
child 27 a629597fd647
Don't mutate the caller's argument.
lib/ezmlm/list.rb
--- a/lib/ezmlm/list.rb	Tue May 30 11:08:48 2017 -0700
+++ b/lib/ezmlm/list.rb	Fri Jun 23 10:54:26 2017 -0700
@@ -70,7 +70,7 @@
 	### 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 @@
 	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 @@
 	###
 	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