[iter] Allow negative step in hb_iota()

This commit is contained in:
Behdad Esfahbod 2019-05-09 11:20:41 -07:00
parent 087327af1e
commit 46837910e6
1 changed files with 1 additions and 1 deletions

View File

@ -567,7 +567,7 @@ struct
{
template <typename T = unsigned, typename S = unsigned> hb_counter_iter_t<T, S>
operator () (T start = 0u, S&& step = 1u) const
{ return hb_counter_iter_t<T, S> (start, hb_int_max (T), step); }
{ return hb_counter_iter_t<T, S> (start, step >= 0 ? hb_int_max (T) : hb_int_min (T), step); }
}
HB_FUNCOBJ (hb_iota);
struct