Skip to content

Commit

Permalink
Merge branch 'master' of github.com:hamza-cskn/obliviate-invs
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-cskn committed Sep 1, 2023
2 parents 4c8d92b + 211c721 commit 53d9769
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,14 @@ public boolean isFirstPage() {
* @return calculates last page's number
*/
public int getLastPage() {
if (this.slots.size() == 0) return 0;
return Math.max(this.items.size() / this.slots.size(), 0);
if (this.slots.isEmpty())
return 0;

int divison = (int) Math.floor(this.items.size() / this.slots.size());

if (this.items.size() % this.slots.size() == 0)
return divison - 1;
return divison;
}

/**
Expand Down

0 comments on commit 53d9769

Please sign in to comment.