mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-17 23:08: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
|
// Prevent player from providing extra wrong answers and still receiving credit
|
||||||
if (result.length !== sanitizedPlayerAnsArr.length) return false;
|
if (result.length !== sanitizedPlayerAnsArr.length) return false;
|
||||||
|
|
||||||
for (const expr of result) {
|
const resultsSet = new Set(result);
|
||||||
if (!sanitizedPlayerAnsArr.includes(expr)) {
|
for (const expr of sanitizedPlayerAnsArr) {
|
||||||
|
if (!resultsSet.has(expr)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user