Skip to content

Commit 93bc308

Browse files
quaffgregturn
authored andcommitted
Polishing.
delegate.getResultWindow() the first time it's called in this method already produces a limit-sized result set, captured in resultsToUse. Running it through the same getResultWindow a second time in unnecessary. Original Pull Request: #3021
1 parent 3b5adcf commit 93bc308

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ScrollDelegate.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
* Delegate to run {@link ScrollPosition scroll queries} and create result {@link Window}.
3636
*
3737
* @author Mark Paluch
38+
* @author Yanming Zhou
3839
* @since 3.1
3940
*/
4041
public class ScrollDelegate<T> {
@@ -90,7 +91,7 @@ private static <T> Window<T> createWindow(Sort sort, int limit, Direction direct
9091
return ScrollPosition.of(keys, direction);
9192
};
9293

93-
return Window.from(delegate.getResultWindow(resultsToUse, limit), positionFunction, hasMoreElements(result, limit));
94+
return Window.from(resultsToUse, positionFunction, hasMoreElements(result, limit));
9495
}
9596

9697
private static <T> Window<T> createWindow(List<T> result, int limit,

0 commit comments

Comments
 (0)