]> git.eshelyaron.com Git - emacs.git/commitdiff
Micro-optimize GXAXIS
authorPo Lu <luangruo@yahoo.com>
Tue, 15 Aug 2023 00:59:03 +0000 (08:59 +0800)
committerPo Lu <luangruo@yahoo.com>
Tue, 15 Aug 2023 00:59:03 +0000 (08:59 +0800)
* src/sfnt.c (GXAXIS): Check for the availability of naxis slot
elements in a single operation.

src/sfnt.c

index 57aa4e3c28ef5ccc6ee1323b078acc917aea73e1..71e7ecfde471aa27d6c08679746c23cee1496916 100644 (file)
@@ -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);                     \
       }                                                \
   }