From 1e2c98126e8500ace31483b05d77478afd59bab8 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 16 Dec 2018 22:30:44 -0500 Subject: [PATCH] [arrays] Remove unused stride from Supplier --- src/hb-machinery.hh | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/hb-machinery.hh b/src/hb-machinery.hh index 41012dd..b2cf8ce 100644 --- a/src/hb-machinery.hh +++ b/src/hb-machinery.hh @@ -644,29 +644,26 @@ struct hb_serialize_context_t template struct Supplier { - Supplier (const Type *array, unsigned int len_, unsigned int stride_=sizeof (Type)) + Supplier (const Type *array, unsigned int len_) { head = array; len = len_; - stride = stride_; } Supplier (hb_array_t v) { head = v.arrayZ; len = v.len; - stride = sizeof (Type); } Supplier (const hb_vector_t &v) { head = (const Type *) v; len = v.len; - stride = sizeof (Type); } const Type operator [] (unsigned int i) const { if (unlikely (i >= len)) return Type (); - return * (const Type *) (const void *) ((const char *) head + stride * i); + return head[i]; } Supplier & operator += (unsigned int count) @@ -674,7 +671,7 @@ struct Supplier if (unlikely (count > len)) count = len; len -= count; - head = (const Type *) (const void *) ((const char *) head + stride * count); + head += count; return *this; } @@ -683,7 +680,6 @@ struct Supplier Supplier& operator= (const Supplier &); /* Disallow copy */ unsigned int len; - unsigned int stride; const Type *head; }; -- 2.7.4