Browse Source

Use Pageable.getOffset() instead of calculating it.

pull/1/head
Oliver Gierke 15 years ago
parent
commit
b975546b55
  1. 2
      spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/MongoCursorUtils.java

2
spring-data-mongodb/src/main/java/org/springframework/data/document/mongodb/repository/MongoCursorUtils.java

@ -102,7 +102,7 @@ abstract class MongoCursorUtils {
return; return;
} }
int toSkip = pageable.getPageSize() * pageable.getPageNumber(); int toSkip = pageable.getOffset();
int first = pageable.getPageSize(); int first = pageable.getPageSize();
cursor.limit(first).skip(toSkip); cursor.limit(first).skip(toSkip);

Loading…
Cancel
Save