mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-16 14:28:36 +02:00
Improve performance of checker for valid math contracts (#1286)
This commit is contained in:
@@ -1282,8 +1282,9 @@ export const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [
|
||||
// Prevent player from providing extra wrong answers and still receiving credit
|
||||
if (result.length !== sanitizedPlayerAnsArr.length) return false;
|
||||
|
||||
for (const expr of result) {
|
||||
if (!sanitizedPlayerAnsArr.includes(expr)) {
|
||||
const resultsSet = new Set(result);
|
||||
for (const expr of sanitizedPlayerAnsArr) {
|
||||
if (!resultsSet.has(expr)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user