Skip to content

Commit cee79a6

Browse files
committed
re used copy function
1 parent 1225158 commit cee79a6

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

src/main/java/io/apimatic/core/types/pagination/PaginatedData.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ public <T> T getPage(Function<CheckedSupplier<P, E>, T> pageSupplier) {
100100
* @return An Iterator of all items of type T.
101101
*/
102102
public <T> Iterator<T> items(Function<CheckedSupplier<I, E>, T> itemSupplier) {
103-
PaginatedData<I, P, R, E> paginatedData = new PaginatedData<>(
104-
firstApiCall, pageCreator, itemsCreator, strategies);
103+
PaginatedData<I, P, R, E> paginatedData = copy();
105104

106105
return new Iterator<T>() {
107106
@Override
@@ -130,8 +129,7 @@ public T next() {
130129
* @return An Iterator of all pages of type T.
131130
*/
132131
public <T> Iterator<T> pages(Function<CheckedSupplier<P, E>, T> pageSupplier) {
133-
PaginatedData<I, P, R, E> paginatedData = new PaginatedData<>(
134-
firstApiCall, pageCreator, itemsCreator, strategies);
132+
PaginatedData<I, P, R, E> paginatedData = copy();
135133

136134
return new Iterator<T>() {
137135
@Override

0 commit comments

Comments
 (0)