Use Pageable.getOffset() instead of calculating it.

This commit is contained in:
Oliver Gierke
2010-12-29 18:05:31 +01:00
parent 9b8137790b
commit b975546b55

View File

@@ -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);