From 46837910e628248edc09e45e212532a3493905da Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 9 May 2019 11:20:41 -0700 Subject: [PATCH] [iter] Allow negative step in hb_iota() --- src/hb-iter.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hb-iter.hh b/src/hb-iter.hh index 1f3c81976..a9981258e 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -567,7 +567,7 @@ struct { template hb_counter_iter_t operator () (T start = 0u, S&& step = 1u) const - { return hb_counter_iter_t (start, hb_int_max (T), step); } + { return hb_counter_iter_t (start, step >= 0 ? hb_int_max (T) : hb_int_min (T), step); } } HB_FUNCOBJ (hb_iota); struct