1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/socket/lib/socket.rb: Specify frozen_string_literal: true.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2015-11-14 13:15:33 +00:00
parent fb2a6ecf9e
commit 373e87a74d
11 changed files with 27 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Sat Nov 14 22:15:07 2015 Tanaka Akira <akr@fsij.org>
* ext/socket/lib/socket.rb: Specify frozen_string_literal: true.
Sat Nov 14 21:44:56 2015 Tanaka Akira <akr@fsij.org>
* lib/time.rb: Use "<<" to reduce string allocation.

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'socket.so'
require 'io/wait'
@ -747,7 +749,7 @@ class Socket < BasicSocket
attr_reader :local_address
def inspect # :nodoc:
"\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>"
"\#<#{self.class}: #{@remote_address.inspect_sockaddr} to #{@local_address.inspect_sockaddr}>".dup
end
# Sends the String +msg+ to the source

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
rescue LoadError

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'test/unit'
require 'socket'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
require "test/unit"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
require "io/nonblock"
@ -129,7 +131,7 @@ class TestSocketNonblock < Test::Unit::TestCase
mesg = u1.recv_nonblock(100)
assert_equal("", mesg)
buf = "short"
buf = "short".dup
out = "hello world" * 4
out.freeze
u2.send(out, 0, u1.getsockname)

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
require "tmpdir"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'test/unit'
require 'socket'

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
require "test/unit"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
require "test/unit"

View file

@ -1,3 +1,5 @@
# frozen_string_literal: true
begin
require "socket"
rescue LoadError
@ -386,7 +388,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
assert_equal("", s1.recv(10))
assert_raise(IO::EAGAINWaitReadable) { s1.recv_nonblock(10) }
buf = ""
buf = "".dup
s2.send("BBBBBB", 0)
IO.select([s1])
rv = s1.recv(100, 0, buf)