Skip to content

Commit

Permalink
Merge pull request #91 from danielmorrison/frozen-string-literals
Browse files Browse the repository at this point in the history
Avoid modifying string literals
  • Loading branch information
thibaudgg committed Aug 29, 2022
2 parents e46390c + e885288 commit 0aacc3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/otnetstring.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class << self
def parse(io, encoding = 'internal', fallback_encoding = nil)
fallback_encoding = io.encoding if io.respond_to? :encoding
io = StringIO.new(io) if io.respond_to? :to_str
length, byte = "", nil
length, byte = String.new, nil

while byte.nil? || byte =~ /\d/
length << byte if byte
Expand Down
4 changes: 2 additions & 2 deletions lib/rb-fsevent/fsevent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ def run
while @running && IO::select([@pipe], nil, nil, nil)
# managing the IO ourselves allows us to be careful and never pass an
# incomplete message to OTNetstring.parse()
message = ""
length = ""
message = String.new
length = String.new
byte = nil

reading_length = true
Expand Down

0 comments on commit 0aacc3c

Please sign in to comment.