* Two "parallel" iterators
@ 2017-09-11 21:56 Victor Porton
0 siblings, 0 replies; only message in thread
From: Victor Porton @ 2017-09-11 21:56 UTC (permalink / raw)
I have two cursors i and j (possibly constructed from two iterators a and b)
and need to check whether they return the same tuple of objects (objects
with the same offset from the beginning of the iterator or the initial
position of the cursor are the same and the number of elements the iterators
make are the same).
Let objects for i and j are o1(i) and o2(j).
As I understand I should not use for-loop with "in iterator", because it
supports only one iterator and I have two.
What is the best (most concise and probably most symmetric) way to express
this algorithm with two iterators or two cursors?
Or should I first make two arrays from two iterators and then just compare
the arrays? It may be a little inefficient, but who bothers?
--
Victor Porton - http://portonvictor.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-09-11 21:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-11 21:56 Two "parallel" iterators Victor Porton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox