Small Fix

-Fixed: HashSet/Map.reduce was using size to iterate instead of array.length
This commit is contained in:
Speiger 2022-05-31 19:05:54 +02:00
parent 36f24731b0
commit 569d4f5c86
4 changed files with 8 additions and 8 deletions

View File

@ -942,7 +942,7 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
state = new BasicEntryKV_BRACES(keys[nullIndex], values[nullIndex]);
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(strategy.equals(keys[i], EMPTY_KEY_VALUE)) continue;
if(empty) {
empty = false;
@ -1173,7 +1173,7 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
state = keys[nullIndex];
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(strategy.equals(keys[i], EMPTY_KEY_VALUE)) continue;
if(empty) {
empty = false;
@ -1329,7 +1329,7 @@ public class CUSTOM_HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VAL
state = values[nullIndex];
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(strategy.equals(keys[i], EMPTY_KEY_VALUE)) continue;
if(empty) {
empty = false;

View File

@ -902,7 +902,7 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
state = new BasicEntryKV_BRACES(keys[nullIndex], values[nullIndex]);
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(KEY_EQUALS_NULL(keys[i])) continue;
if(empty) {
empty = false;
@ -1129,7 +1129,7 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
state = keys[nullIndex];
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(KEY_EQUALS_NULL(keys[i])) continue;
if(empty) {
empty = false;
@ -1285,7 +1285,7 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE
state = values[nullIndex];
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(KEY_EQUALS_NULL(keys[i])) continue;
if(empty) {
empty = false;

View File

@ -589,7 +589,7 @@ public class CUSTOM_HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_T
state = keys[nullIndex];
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(strategy.equals(keys[i], EMPTY_KEY_VALUE)) continue;
if(empty) {
empty = false;

View File

@ -452,7 +452,7 @@ public class HASH_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE imp
state = keys[nullIndex];
empty = false;
}
for(int i = 0;i<size;i++) {
for(int i = nullIndex-1;i>=0;i--) {
if(KEY_EQUALS_NULL(keys[i])) continue;
if(empty) {
empty = false;