From d523b0d20d545602a7ac8ff95e9791a14c3578e0 Mon Sep 17 00:00:00 2001 From: francesco Date: Fri, 17 Jan 2025 17:36:53 +0100 Subject: [PATCH] perf: missing access to property cache Signed-off-by: francesco --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 2390c28a..acae8424 100644 --- a/index.js +++ b/index.js @@ -580,16 +580,18 @@ function buildArray (context, location) { if (schema.additionalItems) { functionCode += ` for (let i = ${itemsSchema.length}; i < arrayLength; i++) { - json += JSON.stringify(obj[i]) + value = obj[i] + json += JSON.stringify(value) if (i < arrayEnd) { json += JSON_STR_COMMA } }` } } else { - const code = buildValue(context, itemsLocation, 'obj[i]') + const code = buildValue(context, itemsLocation, 'value') functionCode += ` for (let i = 0; i < arrayLength; i++) { + value = obj[i] ${code} if (i < arrayEnd) { json += JSON_STR_COMMA