[iter] Fix hb_zip() end condition
authorBehdad Esfahbod <behdad@behdad.org>
Thu, 9 May 2019 18:30:31 +0000 (11:30 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Thu, 9 May 2019 18:31:13 +0000 (11:31 -0700)
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

index d593398..7503312 100644 (file)
@@ -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;