mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
classlib: small PriorityQueue fixes (#823)
This commit is contained in:
parent
1900852cd8
commit
65681e74d8
|
@ -48,8 +48,8 @@ public class TPriorityQueue<E> extends TAbstractQueue<E> implements TSerializabl
|
||||||
initFromSortedSet((TSortedSet<? extends E>) c);
|
initFromSortedSet((TSortedSet<? extends E>) c);
|
||||||
} else {
|
} else {
|
||||||
data = new Object[c.size()];
|
data = new Object[c.size()];
|
||||||
fillFromCollection(c);
|
|
||||||
setComparator(null);
|
setComparator(null);
|
||||||
|
fillFromCollection(c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,6 +170,9 @@ public class TPriorityQueue<E> extends TAbstractQueue<E> implements TSerializabl
|
||||||
if (version != knownVersion) {
|
if (version != knownVersion) {
|
||||||
throw new TConcurrentModificationException();
|
throw new TConcurrentModificationException();
|
||||||
}
|
}
|
||||||
|
if (index >= size) {
|
||||||
|
throw new TNoSuchElementException();
|
||||||
|
}
|
||||||
removeIndex = index;
|
removeIndex = index;
|
||||||
return (E) data[index++];
|
return (E) data[index++];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user