Skip to content

Commit 03d38be

Browse files
committed
Refactor Marshal module to use proper variable names
1 parent e584b76 commit 03d38be

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/main/ruby/truffleruby/core/marshal.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,9 +1387,9 @@ def construct_range(klass)
13871387
end
13881388

13891389
class IOState < State
1390-
def consume(bytes)
1391-
string = @stream.read(bytes)
1392-
raise ArgumentError, 'marshal data too short' if string.bytesize < bytes
1390+
def consume(bytes_count)
1391+
string = @stream.read(bytes_count)
1392+
raise ArgumentError, 'marshal data too short' if string.bytesize < bytes_count
13931393
string
13941394
end
13951395

@@ -1413,11 +1413,11 @@ def inspect
14131413
"#<Marshal::StringState #{@stream[@consumed..-1].inspect}>"
14141414
end
14151415

1416-
def consume(bytes)
1417-
raise ArgumentError, 'marshal data too short' if @consumed + bytes > @stream.bytesize
1418-
data = @stream.byteslice @consumed, bytes
1419-
@consumed += bytes
1420-
data
1416+
def consume(bytes_count)
1417+
raise ArgumentError, 'marshal data too short' if @consumed + bytes_count > @stream.bytesize
1418+
string = @stream.byteslice @consumed, bytes_count
1419+
@consumed += bytes_count
1420+
string
14211421
end
14221422

14231423
def consume_byte

0 commit comments

Comments
 (0)