# HG changeset patch # User Mahlon E. Smith # Date 1498240466 25200 # Node ID a89d91d4b157ba47885e94843c8901d1d217dc43 # Parent 81cc7d47f68f26b556264df0ab1ee3bdf14e06f0 Don't mutate the caller's argument. diff -r 81cc7d47f68f -r a89d91d4b157 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