Avoid negative indexes for JRuby

pull/9722/head
Luc Thevenard 3 years ago
parent d85f03d66a
commit d54cafb7c8
  1. 2
      ruby/lib/google/protobuf/repeated_field.rb

@ -96,7 +96,7 @@ module Google
raise ArgumentError, "negative array size" raise ArgumentError, "negative array size"
else else
start = [self.size-n, 0].max start = [self.size-n, 0].max
return self[start..-1] return self[start...self.size]
end end
end end

Loading…
Cancel
Save