diff --git a/src/hb-open-type-private.hh b/src/hb-open-type-private.hh index 9a059a4e7eff7e250884a84243a16f46153b4bee..c59bb6a53bea3721b08ce10ddb9aad838406faf1 100644 --- a/src/hb-open-type-private.hh +++ b/src/hb-open-type-private.hh @@ -362,20 +362,6 @@ struct hb_sanitize_context_t : }; - -/* Template to sanitize an object. */ -template -struct Sanitizer -{ - inline Sanitizer (unsigned int num_glyphs = 0) { c->set_num_glyphs (num_glyphs); } - inline hb_blob_t *sanitize (hb_blob_t *blob) { return c[0].template/*clang idiosyncrasy*/sanitize_blob (blob); } - - private: - hb_sanitize_context_t c[1]; -}; - - - /* * Serialize */ @@ -1285,7 +1271,7 @@ struct hb_table_lazy_loader_t hb_blob_t *b = (hb_blob_t *) hb_atomic_ptr_get (&blob); if (unlikely (!b)) { - b = OT::Sanitizer(face->get_num_glyphs ()).sanitize (face->reference_table (T::tableTag)); + b = OT::hb_sanitize_context_t().reference_table (face); if (!hb_atomic_ptr_cmpexch (&blob, nullptr, b)) { hb_blob_destroy (b);