From 5da3c9c33f02010a3fc57cf0e1d07955af681e7c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 9 May 2019 11:30:31 -0700 Subject: [PATCH] [iter] Fix hb_zip() end condition We should compare-equal to end if either iterator's end reaches, not if both reach at the same time. Fixes infinite-loop in test which was happening after hb_enumerate() switched to using hb_zip(). --- 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 d5933986d..750331265 100644 --- a/src/hb-iter.hh +++ b/src/hb-iter.hh @@ -479,7 +479,7 @@ struct hb_zip_iter_t : void __rewind__ (unsigned n) { a -= n; b -= n; } hb_zip_iter_t __end__ () const { return hb_zip_iter_t (a.end (), b.end ()); } bool operator != (const hb_zip_iter_t& o) const - { return a != o.a || b != o.b; } + { return a != o.a && b != o.b; } private: A a;