mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-09 17:23:53 +01:00
Merge pull request #2775 from dwRchyngqxs/script_nan_fix
Fixed array comparison handling of NaN
This commit is contained in:
commit
44a6f1b5a8
@ -20,7 +20,8 @@ export function compareArrays<T>(a1: T[], a2: T[]): boolean {
|
||||
if (!compareArrays(elem1, elem2)) {
|
||||
return false;
|
||||
}
|
||||
} else if (a1[i] !== a2[i]) {
|
||||
} else if (a1[i] !== a2[i] && !(Number.isNaN(a1[i]) && Number.isNaN(a2[i]))) {
|
||||
// strict (in)equality considers NaN not equal to itself
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user