After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 78414 - g_queue_remove() and g_queue_remove_all()
g_queue_remove() and g_queue_remove_all()
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.0.x
Other other
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2002-04-11 17:31 UTC by Soren Sandmann Pedersen
Modified: 2011-02-18 16:09 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
adds g_queue_remove() and g_queue_remove_all() (5.34 KB, text/plain)
2002-04-11 17:32 UTC, Soren Sandmann Pedersen
  Details
patch (42.43 KB, patch)
2003-10-01 20:50 UTC, Soren Sandmann Pedersen
none Details | Review
New patch (43.30 KB, patch)
2003-10-06 13:33 UTC, Soren Sandmann Pedersen
none Details | Review

Description Soren Sandmann Pedersen 2002-04-11 17:31:45 UTC
Here is a patch to add these two functions to GQueue
Comment 1 Soren Sandmann Pedersen 2002-04-11 17:32:43 UTC
Created attachment 7657 [details]
adds g_queue_remove() and g_queue_remove_all()
Comment 2 Owen Taylor 2002-05-07 18:14:29 UTC
What's the objective criterion for deciding what additional
functions get added to GQueue? Why these two in particular?
Comment 3 Soren Sandmann Pedersen 2002-05-10 18:25:19 UTC
I needed these two functions in particular, but I don't know the
objective criterion for which functions get added. (And I don't care
that much for these two functions).
Comment 4 Owen Taylor 2002-11-14 21:11:23 UTC
Does the patch really handle the case where the node
removed is the tail correctly?
Comment 5 Soren Sandmann Pedersen 2002-11-14 21:52:39 UTC
No it doesn't. It needs to update the tail pointer.
Comment 6 Owen Taylor 2002-11-19 20:51:16 UTC
Assuming that we don't add GRing and deprecate GQueue, I
think it probably makes sense to complete GQueue to have
a full GList/GSList equivalent API set.
Comment 7 Soren Sandmann Pedersen 2003-09-18 18:50:39 UTC
Some discussion in 
http://mail.gnome.org/archives/gtk-devel-list/2003-September/msg00240.html
Comment 8 Soren Sandmann Pedersen 2003-10-01 20:50:47 UTC
Created attachment 20415 [details] [review]
patch
Comment 9 Soren Sandmann Pedersen 2003-10-06 13:33:43 UTC
Created attachment 20503 [details] [review]
New patch
Comment 10 Tim Janik 2004-02-20 14:43:26 UTC
i'm not particularly fond of adding the new API here. for one, i don't
rule out addition of GRing in the future, since from my experience it
offers a far supperior API to GQueue. for another, i'd like to see
this new API get some discussion on gtk-devel-list prior to inclusion.
on the technical side, the implementation has some issues, it should
make better use of existing g_list API (e.g. to access the nth
element) which had several validation passes for correctness already,
and to make use of improvements/optimizations in that code (e.g.
g_list_free() is O(1) for n elements, while queue_remove_all is not).
Comment 11 Matthias Clasen 2004-02-20 14:48:07 UTC
Tim, the GRing bug has been WONTFIXed.


The gtk-devel-list discussion is linked above. 


Do you want it discussed once more ? 
Comment 12 Matthias Clasen 2004-02-20 15:08:06 UTC
For reference, bug 59431 is the original GRing proposal, and


http://mail.gnome.org/archives/gtk-devel-list/2002-November/msg00097.
html 


is Owens rationale for WONTFIXing it.
Comment 13 Tim Janik 2004-02-20 16:07:39 UTC
thanks for the links matthias. yes, i intend to resurrect a GRing
discussion in the future, basically because i don't agree with owen's
rationale. i just haven't found the time to reply to that, and it
looks like GRing stays somewhat low on my priority queue for still
some time, since there're lots of other more pressing issues that
require my attention.
Comment 14 Soren Sandmann Pedersen 2004-02-21 12:52:38 UTC
I have committed this. See

http://mail.gnome.org/archives/gtk-devel-list/2004-February/msg00129.html

for an explanation.