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

Comparing jsr166/src/main/java/util/ArrayDeque.java (file contents):
Revision 1.132 by jsr166, Sun Oct 22 17:44:02 2017 UTC vs.
Revision 1.133 by jsr166, Sat Feb 24 22:04:18 2018 UTC

# Line 209 | Line 209 | public class ArrayDeque<E> extends Abstr
209       */
210      public ArrayDeque(Collection<? extends E> c) {
211          this(c.size());
212 <        addAll(c);
212 >        copyElements(c);
213      }
214  
215      /**
# Line 325 | Line 325 | public class ArrayDeque<E> extends Abstr
325          final int s, needed;
326          if ((needed = (s = size()) + c.size() + 1 - elements.length) > 0)
327              grow(needed);
328 <        c.forEach(this::addLast);
328 >        copyElements(c);
329          // checkInvariants();
330          return size() > s;
331      }
332  
333 +    private void copyElements(Collection<? extends E> c) {
334 +        c.forEach(this::addLast);
335 +    }
336 +
337      /**
338       * Inserts the specified element at the front of this deque.
339       *

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines