From a8365aa841d9ca6bafedccae0970e4a269c1e933 Mon Sep 17 00:00:00 2001 From: Po Lu Date: Tue, 15 Aug 2023 08:59:03 +0800 Subject: [PATCH] Micro-optimize GXAXIS * src/sfnt.c (GXAXIS): Check for the availability of naxis slot elements in a single operation. --- src/sfnt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/sfnt.c b/src/sfnt.c index 57aa4e3c28e..71e7ecfde47 100644 --- a/src/sfnt.c +++ b/src/sfnt.c @@ -6635,16 +6635,19 @@ sfnt_interpret_trap (struct sfnt_interpreter *interpreter, #define GXAXIS() \ { \ uint32_t v; \ - int i; \ + int i, naxis; \ + \ + naxis = interpreter->n_axis; \ + CHECK_STACK_AVAILABLE (naxis); \ \ - for (i = 0; i < interpreter->n_axis; ++i) \ + for (i = 0; i < naxis; ++i) \ { \ if (interpreter->norm_coords) \ v = interpreter->norm_coords[i] / 4; \ else \ v = 0; \ \ - PUSH (v); \ + PUSH_UNCHECKED (v); \ } \ } -- 2.39.2