[ImageJ-devel] Simplifying loops?

Stephan Preibisch preibisch at mpi-cbg.de
Mon Jun 14 11:34:55 CDT 2010


This is definitely something we could do as far as the linked iterators
work. Right now we did not do that because it is quite often extra work,
e.g. if you copy an image you need only one check instead of two:

cursor1, cursor2;

while ( cursor1.hasNext() ) 
{
	cursor1.fwd();
	cursor2.fwd();
	// meat of the loop
}

Steffi

-----Original Message-----
From: Johannes Schindelin [mailto:Johannes.Schindelin at gmx.de] 
Sent: Monday, June 14, 2010 6:20 PM
To: preibisch at mpi-cbg.de; saalfeld at mpi-cbg.de
Cc: fiji-devel at googlegroups.com; imagej-devel at imagejdev.org
Subject: Simplifying loops?

Hi,

I wonder whether we can shorten

	while (cursor.hasNext()) {
		cursor.fwd();
		// meat of the loop
	}

to

	while (cursor.fwd()) {
		// meat of the loop
	}

?

Ciao,
Dscho






More information about the ImageJ-devel mailing list