Skip to content

Commit 3dffe60

Browse files
committed
Fix Performance/UnfreezeString Rubocop offences.
1 parent 41e213b commit 3dffe60

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,6 @@ Layout/LineContinuationSpacing:
2121
Exclude:
2222
- 'lib/zip/bzip2/errors.rb'
2323

24-
# Offense count: 3
25-
# This cop supports unsafe autocorrection (--autocorrect-all).
26-
Performance/UnfreezeString:
27-
Exclude:
28-
- 'lib/zip/bzip2/decompress.rb'
29-
- 'lib/zip/bzip2/decompressor.rb'
30-
3124
# Offense count: 9
3225
# This cop supports safe autocorrection (--autocorrect).
3326
Style/FileRead:

lib/zip/bzip2/decompress.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def initialize(options = {})
1818
end
1919

2020
def decompress(data)
21-
result = ''.dup
21+
result = +''
2222

2323
with_input_buffer(data) do |input_buffer|
2424
@libbz2.input_buffer = input_buffer

lib/zip/bzip2/decompressor.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class Decompressor < ::Zip::Decompressor #:nodoc:
88
def initialize(*args)
99
super
1010

11-
@buffer = ''.dup
11+
@buffer = +''
1212
@bzip2_ffi_decompressor = ::Zip::Bzip2::Decompress.new
1313
end
1414

15-
def read(length = nil, outbuf = ''.dup)
15+
def read(length = nil, outbuf = +'')
1616
return return_value_on_eof(length) if eof
1717

1818
fill_buffer(length)

0 commit comments

Comments
 (0)