Use hb_bytes_t as<T> in hb_blob_t
This commit is contained in:
parent
dce42cef2b
commit
4ef08dbce1
|
@ -54,13 +54,9 @@ struct hb_blob_t
|
||||||
HB_INTERNAL bool try_make_writable_inplace ();
|
HB_INTERNAL bool try_make_writable_inplace ();
|
||||||
HB_INTERNAL bool try_make_writable_inplace_unix ();
|
HB_INTERNAL bool try_make_writable_inplace_unix ();
|
||||||
|
|
||||||
|
hb_bytes_t as_bytes () const { return hb_bytes_t (data, length); }
|
||||||
template <typename Type>
|
template <typename Type>
|
||||||
const Type* as () const
|
const Type* as () const { return as_bytes ().as<Type> (); }
|
||||||
{
|
|
||||||
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); }
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
hb_object_header_t header;
|
hb_object_header_t header;
|
||||||
|
|
Loading…
Reference in New Issue