Re: number list elements problem
- From: Sven Neumann <sven gimp org>
- To: francex tiscali it
- Cc: gtk-list gnome org
- Subject: Re: number list elements problem
- Date: 26 Dec 2003 21:19:18 +0100
Hi,
francex tiscali it 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]