New Stuff

-Fixed: Crash with FIFOQueues peek function when loops were applied.
-Fixed: FIFOQueues clean function was doing unessesary extra work.
-Added: Stream Overrides functions now support sorted.
-Updated: Changelog.
-Added: A couple more badges because why not.
This commit is contained in:
2022-04-21 17:25:23 +02:00
parent 4d3eaaf604
commit 5fa26bfbf3
9 changed files with 163 additions and 9 deletions
@@ -106,10 +106,15 @@ public class ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEUE K
@Override
public void clear() {
if(first != last) {
#if TYPE_OBJECT
Arrays.fill(array, null);
Arrays.fill(array, null);
#endif
first = last = 0;
first = last = 0;
}
else if(first != 0) {
first = last = 0;
}
}
@Override
@@ -152,9 +157,9 @@ public class ARRAY_FIFO_QUEUE KEY_GENERIC_TYPE extends ABSTRACT_PRIORITY_QUEUE K
@Override
public KEY_TYPE peek(int index) {
if(first == last || index < 0 || index > size()) throw new NoSuchElementException();
if(first == last || index < 0 || index >= size()) throw new NoSuchElementException();
index += first;
return index > array.length ? array[index-array.length] : array[index];
return index >= array.length ? array[index-array.length] : array[index];
}
@Override