mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-23 07:51:10 +01:00
[varc] Remove one vector allocation
This commit is contained in:
1 parent
761468c66f
commit
49c5ed38e4
2 files changed
+5
-5
No files matched your search
@@ -188,18 +188,17 @@ VarComponent::get_path_at (hb_font_t *font,
|
||||
// Axis values
|
||||
|
||||
hb_vector_t<unsigned> axisIndices;
|
||||
hb_vector_t<signed> axisValuesInt;
|
||||
hb_vector_t<float> axisValues;
|
||||
if (flags & (unsigned) flags_t::HAVE_AXES)
|
||||
{
|
||||
unsigned axisIndicesIndex;
|
||||
READ_UINT32VAR (axisIndicesIndex);
|
||||
axisIndices = (&VARC+VARC.axisIndicesList)[axisIndicesIndex];
|
||||
axisValuesInt.resize (axisIndices.length);
|
||||
axisValues.resize (axisIndices.length);
|
||||
const HBUINT8 *p = (const HBUINT8 *) record;
|
||||
TupleValues::decompile (p, axisValuesInt, (const HBUINT8 *) end);
|
||||
TupleValues::decompile (p, axisValues, (const HBUINT8 *) end);
|
||||
record += (const unsigned char *) p - record;
|
||||
}
|
||||
hb_vector_t<float> axisValues (axisValuesInt);
|
||||
|
||||
// Apply variations if any
|
||||
if (flags & (unsigned) flags_t::AXIS_VALUES_HAVE_VARIATION)
|
||||
|
||||
+2
-1
@@ -1715,8 +1715,9 @@ struct TupleValues
|
||||
return encoded_len;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
static bool decompile (const HBUINT8 *&p /* IN/OUT */,
|
||||
hb_vector_t<int> &values /* IN/OUT */,
|
||||
hb_vector_t<T> &values /* IN/OUT */,
|
||||
const HBUINT8 *end,
|
||||
bool consume_all = false)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user