Use hb_bytes_t as<T> in hb_blob_t

This commit is contained in:
Ebrahim Byagowi 2019-08-27 14:49:46 +04:30
parent dce42cef2b
commit 4ef08dbce1
1 changed files with 2 additions and 6 deletions

View File

@ -54,13 +54,9 @@ struct hb_blob_t
HB_INTERNAL bool try_make_writable_inplace ();
HB_INTERNAL bool try_make_writable_inplace_unix ();
hb_bytes_t as_bytes () const { return hb_bytes_t (data, length); }
template <typename Type>
const Type* as () const
{
return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast<const Type *> (data);
}
hb_bytes_t as_bytes () const
{ return hb_bytes_t (data, length); }
const Type* as () const { return as_bytes ().as<Type> (); }
public:
hb_object_header_t header;