Skip to content

Commit

Permalink
more verbose condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ddnexus committed Apr 19, 2021
1 parent fe565eb commit 9fb1195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/pagy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def initialize(vars)
def series(size=@vars[:size])
return [] if size.empty?
raise VariableError.new(self), "expected 4 items >= 0 in :size; got #{size.inspect}" \
unless size.size == 4 && size.all?{ |num| num >= 0 rescue false } # rubocop:disable Style/RescueModifier
unless size.size == 4 && size.all?{ |num| !num.negative? rescue false } # rubocop:disable Style/RescueModifier
# This algorithm is up to ~5x faster and ~2.3x lighter than the previous one (pagy < 4.3)
left_gap_start = 1 + size[0]
left_gap_end = @page - size[1] - 1
Expand Down

0 comments on commit 9fb1195

Please sign in to comment.