Skip to content

Commit

Permalink
Avoid negative indexes for JRuby
Browse files Browse the repository at this point in the history
  • Loading branch information
lucthev committed Apr 6, 2022
1 parent d85f03d commit d54cafb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ruby/lib/google/protobuf/repeated_field.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def last(n=nil)
raise ArgumentError, "negative array size"
else
start = [self.size-n, 0].max
return self[start..-1]
return self[start...self.size]
end
end

Expand Down

0 comments on commit d54cafb

Please sign in to comment.