totalPage static method

int totalPage(
  1. int totalCount,
  2. int pageSize
)

根据总数计算总页数

Implementation

static int totalPage(int totalCount, int pageSize) {
  if (pageSize == 0) return 0;
  return totalCount % pageSize == 0
      ? totalCount ~/ pageSize
      : (totalCount ~/ pageSize + 1);
}