Skip to content

Commit

Permalink
mod: optimize replacement from gsub to chomp
Browse files Browse the repository at this point in the history
  • Loading branch information
TomFreudenberg committed Aug 31, 2018
1 parent f745a51 commit ac14b9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/midi-smtp-server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -804,9 +804,9 @@ def process_line(line)
# told to finish data mode

# remove empty line
Thread.current[:ctx][:message][:data].gsub!(/\r\n\Z/, '')
Thread.current[:ctx][:message][:data].chomp!('')
# remove ending line period (.)
Thread.current[:ctx][:message][:data].gsub!(/\.\Z/, '')
Thread.current[:ctx][:message][:data].chomp!('.')
# save delivered UTC time
Thread.current[:ctx][:message][:delivered] = Time.now.utc
# save bytesize of message data
Expand Down

0 comments on commit ac14b9e

Please sign in to comment.