From 44a5de3a97c6092547d4994c7b10922fbdce15b8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 3 Dec 2022 12:50:32 -0700 Subject: [PATCH] [Device] Save a snap/revert --- src/hb-ot-layout-common.hh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh index b1b47ded3..87c0ae2f5 100644 --- a/src/hb-ot-layout-common.hh +++ b/src/hb-ot-layout-common.hh @@ -3455,16 +3455,14 @@ struct VariationDevice { TRACE_SERIALIZE (this); if (!layout_variation_idx_delta_map) return_trace (nullptr); - auto snap = c->snapshot (); - auto *out = c->embed (this); - if (unlikely (!out)) return_trace (nullptr); hb_pair_t *v; if (!layout_variation_idx_delta_map->has (varIdx, &v)) - { - c->revert (snap); return_trace (nullptr); - } + + auto *out = c->embed (this); + if (unlikely (!out)) return_trace (nullptr); + unsigned new_idx = hb_first (*v); out->varIdx = new_idx; return_trace (out);