From 4ef08dbce1a9acd7e941168245c96e010248ecb6 Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 27 Aug 2019 14:49:46 +0430 Subject: [PATCH] Use hb_bytes_t as in hb_blob_t --- src/hb-blob.hh | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/hb-blob.hh b/src/hb-blob.hh index cff492fa0..d85bd823b 100644 --- a/src/hb-blob.hh +++ b/src/hb-blob.hh @@ -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 - const Type* as () const - { - return length < hb_null_size (Type) ? &Null(Type) : reinterpret_cast (data); - } - hb_bytes_t as_bytes () const - { return hb_bytes_t (data, length); } + const Type* as () const { return as_bytes ().as (); } public: hb_object_header_t header;