Tiny improvement on previous commit

Functionally the same.
This commit is contained in:
Behdad Esfahbod 2020-11-25 11:51:37 -07:00
parent a5f6f869e8
commit 53806e5b83
3 changed files with 3 additions and 1 deletions

View File

@ -90,6 +90,7 @@ struct hb_blob_ptr_t
unsigned int get_length () const { return b.get ()->length; }
void destroy () { hb_blob_destroy (b.get ()); b = nullptr; }
private:
hb_nonnull_ptr_t<hb_blob_t> b;
};

View File

@ -177,6 +177,7 @@ struct hb_nonnull_ptr_t
T * get () const { return v ? v : const_cast<T *> (&Null (T)); }
T * get_raw () const { return v; }
private:
T *v;
};

View File

@ -3380,7 +3380,7 @@ struct GSUBGPOS
if (unlikely (!this->accels))
{
this->lookup_count = 0;
hb_blob_destroy (this->table.get_blob ());
this->table.destroy ();
this->table = hb_blob_get_empty ();
}