From 4c38a9f6011a9b1dd6c4fc98620e23decc340322 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 29 Mar 2019 20:23:07 -0700 Subject: [PATCH] Remove hb_assign() Not needed anymore. We just use operator= now. --- src/hb-iter.hh | 2 +- src/hb-machinery.hh | 2 +- src/hb-null.hh | 13 ------------- src/hb-open-type.hh | 2 +- 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 917ffc7..d596334 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -544,7 +544,7 @@ inline void hb_fill (C& c, const V &v) { for (auto i = hb_iter (c); i; i++) - hb_assign (*i, v); + *i = v; } template may_edit (obj, hb_static_size (Type))) { - hb_assign (* const_cast (obj), v); + * const_cast (obj) = v; return true; } return false; diff --git a/src/hb-null.hh b/src/hb-null.hh index 21810b2..9d23d50 100644 --- a/src/hb-null.hh +++ b/src/hb-null.hh @@ -76,19 +76,6 @@ struct hb_static_size #define hb_static_size(T) hb_static_size::value -/* hb_assign (obj, value) - * Calls obj.set (value) if obj.min_size is defined and value has different type - * from obj, or obj = v otherwise. */ - -template -struct _hb_assign -{ static inline void value (T &o, const V v) { o = v; } }; - -template -static inline void hb_assign (T &o, const V v) -{ _hb_assign::value (o, v); } - - /* * Null() */ diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 5756a9b..26df8e7 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -584,7 +584,7 @@ struct ArrayOf /* TODO Umm. Just exhaust the iterator instead? Being extra * cautious right now.. */ for (unsigned i = 0; i < count; i++, items++) - hb_assign (arrayZ[i], *items); + arrayZ[i] = *items; return_trace (true); } -- 2.7.4