RE: The iterator interface



On Mon, 2006-08-07 at 13:29 +0300, Dirk-Jan Binnema nokia com wrote:
>  
> Hmmm.... I was thinking about programmer friendliness; if I always
> have to unref the reference, I always have to assign the retval
> to a variable, and do the unref.
> 
> However, maybe I'd like to do something like:
> 
> while (!tny_iterator_iface_is_done (iter)) {
> 	do_something_nifty (tny_iterator_iface_current(iter, FALSE));
> 	tny_iterator_iface_next (iter);
> }

while (!tny_iterator_iface_is_done (iter)) {
	GObject *a;
	do_something_nifty (a = tny_iterator_iface_current(iter));
	g_object_unref (a);
	tny_iterator_iface_next (iter);
}

> Of course, nothing really special, but it would make for a little
> bit nicer client code. Alternatively, instead of the boolean, we
> could have tny_iterator_iface_current_floating.

Naaah. To much API in my opinion. Let's be consistent.

Now, who's going to write the patch? :). I can't. Mickey Mouse doesn't
allow me. 

> Anyway, not a big deal. 

-- 
Philip Van Hoof, software developer at x-tend 
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
work: vanhoof at x-tend dot be 
http://www.pvanhoof.be - http://www.x-tend.be




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]