Loop weirdness

Ikke eikke at eikke.com
Tue May 9 05:29:02 PDT 2006


I was just looking at some HAL code, and some strange construct took my
attention, in hald/hald.c:

	gdl = hald_get_gdl ();
next:
	if (g_slist_length (gdl->devices) > 0) {
		HalDevice *d = HAL_DEVICE(gdl->devices->data);
		hal_device_store_remove (gdl, d);
		g_object_unref (d);
		goto next;
	}

Maybe there's a very good reason to use such a construct, if so, please 
explain me why it should be this way. If there's no: what's wrong with 
a simple while(...) loop?

Regards,

Ikke
http://www.eikke.com



More information about the hal mailing list