refactor(pagination): reduce number of operations when no maxSize is set