summaryrefslogtreecommitdiff
path: root/lib/net
diff options
context:
space:
mode:
authorkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-04 08:22:10 +0000
committerkazu <kazu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-04 08:22:10 +0000
commitc01a5ee85e2d6a7128cccafb143bfa694284ca87 (patch)
treef2022f55e2ea3047ffda6f3288e43c9d407fd7d3 /lib/net
parenta94cbf81e1fcef1f50af631e3b1117c2bf68df7f (diff)
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
Diffstat (limited to 'lib/net')
-rw-r--r--lib/net/protocol.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net/protocol.rb b/lib/net/protocol.rb
index 037fcd8358..71378af804 100644
--- a/lib/net/protocol.rb
+++ b/lib/net/protocol.rb
@@ -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)"