Skip to content

Commit

Permalink
Improve code from Rubocop
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredcwhite committed Jan 2, 2023
1 parent 3c6ccb7 commit 4e8a34c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions bridgetown-paginate/lib/bridgetown-paginate/paginator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ def initialize( # rubocop:todo Metrics/AbcSize
end

init = (@page - 1) * @per_page
offset = if init + @per_page - 1 >= documents.size
documents.size
else
init + @per_page - 1
end
offset = [init + @per_page - 1, documents.size].min

# Ensure that the current page has correct extensions if needed
this_page_url = Utils.ensure_full_path(
Expand Down

0 comments on commit 4e8a34c

Please sign in to comment.