ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/LinkedBlockingDeque.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/LinkedBlockingDeque.java (file contents):
Revision 1.72 by jsr166, Mon Dec 26 17:29:35 2016 UTC vs.
Revision 1.73 by jsr166, Mon Dec 26 19:54:45 2016 UTC

# Line 1174 | Line 1174 | public class LinkedBlockingDeque<E>
1174  
1175          public Spliterator<E> trySplit() {
1176              Node<E> h;
1177            int b = batch;
1178            int n = (b <= 0) ? 1 : (b >= MAX_BATCH) ? MAX_BATCH : b + 1;
1177              if (!exhausted &&
1178                  ((h = current) != null || (h = first) != null)
1179                  && h.next != null) {
1180 +                int n = batch = Math.min(batch + 1, MAX_BATCH);
1181                  Object[] a = new Object[n];
1182                  final ReentrantLock lock = LinkedBlockingDeque.this.lock;
1183                  int i = 0;
# Line 1199 | Line 1198 | public class LinkedBlockingDeque<E>
1198                  }
1199                  else if ((est -= i) < 0L)
1200                      est = 0L;
1201 <                if (i > 0) {
1203 <                    batch = i;
1201 >                if (i > 0)
1202                      return Spliterators.spliterator
1203                          (a, 0, i, (Spliterator.ORDERED |
1204                                     Spliterator.NONNULL |
1205                                     Spliterator.CONCURRENT));
1208                }
1206              }
1207              return null;
1208          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines