[config] Add HB_OPTIMIZE_SIZE_VAL
diff --git a/src/hb-config.hh b/src/hb-config.hh
index 52adaad..8c54c2a 100644
--- a/src/hb-config.hh
+++ b/src/hb-config.hh
@@ -186,6 +186,11 @@
#define HB_OPTIMIZE_SIZE
#endif
#endif
+#ifdef HB_OPTIMIZE_SIZE
+#define HB_OPTIMIZE_SIZE_VAL 1
+#else
+#define HB_OPTIMIZE_SIZE_VAL 0
+#endif
#ifdef HB_OPTIMIZE_SIZE
#define HB_NO_OT_LAYOUT_LOOKUP_CACHE
diff --git a/src/hb-ot-var-gvar-table.hh b/src/hb-ot-var-gvar-table.hh
index 23b3081..cd96e72 100644
--- a/src/hb-ot-var-gvar-table.hh
+++ b/src/hb-ot-var-gvar-table.hh
@@ -368,14 +368,7 @@
hb_memset (deltas.arrayZ, 0, deltas.get_size ());
}
- bool optimize_size =
-#ifdef HB_OPTIMIZE_SIZE
- true
-#else
- false
-#endif
- ;
- if (optimize_size)
+ if (HB_OPTIMIZE_SIZE_VAL)
{
for (unsigned int i = 0; i < num_deltas; i++)
{
diff --git a/src/hb-vector.hh b/src/hb-vector.hh
index 58d467a..d61ce48 100644
--- a/src/hb-vector.hh
+++ b/src/hb-vector.hh
@@ -290,13 +290,11 @@
copy_vector (const hb_vector_t &other)
{
length = other.length;
-#ifndef HB_OPTIMIZE_SIZE
- if (sizeof (T) >= sizeof (long long))
+ if (!HB_OPTIMIZE_SIZE_VAL && sizeof (T) >= sizeof (long long))
/* This runs faster because of alignment. */
for (unsigned i = 0; i < length; i++)
arrayZ[i] = other.arrayZ[i];
else
-#endif
hb_memcpy ((void *) arrayZ, (const void *) other.arrayZ, length * item_size);
}
template <typename T = Type,