GNOME Bugzilla – Bug 578873
[PATCH] Added an iterator to gtree that accepts a range
Last modified: 2018-05-24 11:50:16 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.
Created attachment 132612 [details] [review] adds g_tree_foreach_inrange Adds the prototype and body for g_tree_foreach_inrange
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
Created attachment 132614 [details] sample C code that uses g_tree_foreach_inrange
*** Bug 169285 has been marked as a duplicate of this bug. ***
-- 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.