Use delete_prefix instead of sub(/\Afixed-pattern/, '')

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kazu 2018-12-04 08:22:10 +00:00
parent a94cbf81e1
commit c01a5ee85e
6 changed files with 8 additions and 8 deletions

View file

@ -311,7 +311,7 @@ module Net # :nodoc:
read_bytes = 0
while (line = readuntil("\r\n")) != ".\r\n"
read_bytes += line.size
yield line.sub(/\A\./, '')
yield line.delete_prefix('.')
end
LOG_on()
LOG "read message (#{read_bytes} bytes)"