mirror of
https://github.com/processing/processing4.git
synced 2026-02-13 18:35:37 +01:00
more NaN check business
This commit is contained in:
@@ -671,6 +671,9 @@ public class FloatDict {
|
||||
if (useKeys) {
|
||||
return count; // don't worry about NaN values
|
||||
|
||||
} else if (count == 0) { // skip the NaN check, it'll AIOOBE
|
||||
return 0;
|
||||
|
||||
} else { // first move NaN values to the end of the list
|
||||
int right = count - 1;
|
||||
while (values[right] != values[right]) {
|
||||
|
||||
@@ -566,6 +566,10 @@ public class FloatList implements Iterable<Float> {
|
||||
new Sort() {
|
||||
@Override
|
||||
public int size() {
|
||||
// if empty, don't even mess with the NaN check, it'll AIOOBE
|
||||
if (count == 0) {
|
||||
return 0;
|
||||
}
|
||||
// move NaN values to the end of the list and don't sort them
|
||||
int right = count - 1;
|
||||
while (data[right] != data[right]) {
|
||||
|
||||
Reference in New Issue
Block a user