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 578873 - [PATCH] Added an iterator to gtree that accepts a range
[PATCH] Added an iterator to gtree that accepts a range
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: gtkdev
gtkdev
: 169285 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-04-13 20:08 UTC by Sean Cumming
Modified: 2018-05-24 11:50 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
adds g_tree_foreach_inrange (3.89 KB, patch)
2009-04-13 20:09 UTC, Sean Cumming
none Details | Review
prevents requesting inrange(a,b) with b<a (956 bytes, text/plain)
2009-04-13 20:10 UTC, Sean Cumming
  Details
sample C code that uses g_tree_foreach_inrange (569 bytes, text/plain)
2009-04-13 20:11 UTC, Sean Cumming
  Details

Description Sean Cumming 2009-04-13 20:08:24 UTC
I found that I repeatedly wanted all the values stored in a GTree in a given range.  Without this patch, given a range of {a,b}, I would have to issue a look up for each of a, a+1.. b and test if the key was found.  With this patch I specific the lower and upper boundaries, and will only be called back on values in that range.
Comment 1 Sean Cumming 2009-04-13 20:09:28 UTC
Created attachment 132612 [details] [review]
adds g_tree_foreach_inrange

Adds the prototype and body for g_tree_foreach_inrange
Comment 2 Sean Cumming 2009-04-13 20:10:44 UTC
Created attachment 132613 [details]
prevents requesting inrange(a,b) with b<a

Adds a sanity check to for each in range, returning early if upper_bound < lower_bound
Comment 3 Sean Cumming 2009-04-13 20:11:35 UTC
Created attachment 132614 [details]
sample C code that uses g_tree_foreach_inrange
Comment 4 Matthias Clasen 2010-07-10 06:18:24 UTC
*** Bug 169285 has been marked as a duplicate of this bug. ***
Comment 5 GNOME Infrastructure Team 2018-05-24 11:50:16 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/213.