Skip to content

Commit 8b25a9d

Browse files
committed
Run all unsafe autocorrections
1 parent 44501ec commit 8b25a9d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/tiny_tds/bin.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def binary?(file)
9696
return false unless bytes
9797
bytes = 4096 if bytes > 4096
9898
s = (File.read(file, bytes) || "")
99-
s = s.encode("US-ASCII", undef: :replace).split("")
99+
s = s.encode("US-ASCII", undef: :replace).chars
100100
((s.size - s.grep(" ".."~").size) / s.size.to_f) > 0.30
101101
end
102102
end

test/client_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class ClientTest < TinyTds::TestCase
4747
assert_equal encoding, client.charset
4848
assert_equal Encoding.find(encoding), client.encoding
4949
ensure
50-
client.close if client
50+
client&.close
5151
end
5252
end
5353

@@ -58,7 +58,7 @@ class ClientTest < TinyTds::TestCase
5858
begin
5959
client = new_connection dataserver: nil, host: host, port: port
6060
ensure
61-
client.close if client
61+
client&.close
6262
end
6363
end
6464
end

0 commit comments

Comments
 (0)