Re: number list elements problem

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

 



Hi,

francex@xxxxxxxxxx writes:

> g_slist_remove_link (list, g_slist_nth (list, position));

You _always_ need to assign the returned list argument to your list
pointer or your code will break if the head of the list is modified.
Try to change that line to

  list = g_slist_remove_link (list, g_slist_nth (list, position));

BTW, you are using the list in a very inefficient way here. In order
for the node to be removed the list is traversed twice. This should be
avoided if you intent to put a lot of nodes into your list.


Sven
_______________________________________________

gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux