[groovy] branch master updated: Tweak `lead` window function

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[groovy] branch master updated: Tweak `lead` window function

Daniel.Sun
This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git


The following commit(s) were added to refs/heads/master by this push:
     new 0cbe7a2  Tweak `lead` window function
0cbe7a2 is described below

commit 0cbe7a256acaa5f823bf98095b34e89002f41381
Author: Daniel Sun <[hidden email]>
AuthorDate: Sat Jan 9 15:46:30 2021 +0800

    Tweak `lead` window function
---
 .../org/apache/groovy/ginq/provider/collection/runtime/WindowImpl.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/WindowImpl.java b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/WindowImpl.java
index 5cbb386..6422f01 100644
--- a/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/WindowImpl.java
+++ b/subprojects/groovy-ginq/src/main/groovy/org/apache/groovy/ginq/provider/collection/runtime/WindowImpl.java
@@ -88,7 +88,7 @@ class WindowImpl<T, U extends Comparable<? super U>> extends QueryableCollection
         V field;
         if (0 == lead) {
             field = extractor.apply(currentRecord.getV1());
-        } else if (0 <= index + lead && index + lead < this.size()) {
+        } else if (0 <= index + lead && index + lead < list.size()) {
             field = extractor.apply(list.get(index + (int) lead));
         } else {
             field = def;

Apache Groovy committer & PMC member

Blog: http://blog.sunlan.me
Twitter: @daniel_sun