[Device] Save a map get()

This commit is contained in:
Behdad Esfahbod 2022-12-03 12:49:26 -07:00
parent 630b874ae6
commit 93328cedfc
1 changed files with 3 additions and 3 deletions

View File

@ -3459,13 +3459,13 @@ struct VariationDevice
auto *out = c->embed (this); auto *out = c->embed (this);
if (unlikely (!out)) return_trace (nullptr); if (unlikely (!out)) return_trace (nullptr);
/* TODO Just get() and bail if NO_VARIATION. Needs to setup the map to return that. */ hb_pair_t<unsigned, int> *v;
if (!layout_variation_idx_delta_map->has (varIdx)) if (!layout_variation_idx_delta_map->has (varIdx, &v))
{ {
c->revert (snap); c->revert (snap);
return_trace (nullptr); return_trace (nullptr);
} }
unsigned new_idx = hb_first (layout_variation_idx_delta_map->get (varIdx)); unsigned new_idx = hb_first (*v);
out->varIdx = new_idx; out->varIdx = new_idx;
return_trace (out); return_trace (out);
} }