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 776558 - Add some more Traversable<G> query operations
Add some more Traversable<G> query operations
Status: RESOLVED FIXED
Product: libgee
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: libgee-maint
libgee-maint
Depends on:
Blocks:
 
 
Reported: 2016-12-29 00:05 UTC by Rodrigo Moya
Modified: 2017-01-29 21:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that adds some useful query operations to Traversable<G> (6.35 KB, patch)
2016-12-29 00:05 UTC, Rodrigo Moya
none Details | Review
Add some more query operations for Traversable<G> (6.57 KB, patch)
2017-01-17 13:30 UTC, Rico Tzschichholz
committed Details | Review

Description Rodrigo Moya 2016-12-29 00:05:14 UTC
Created attachment 342558 [details] [review]
Patch that adds some useful query operations to Traversable<G>

The already existing Traversable<G> query operations are great for dealing
with collections in a LINQ-like manner, so while using them I've misssed some useful ones from LINQ. The attached patch implements some of those.
Comment 1 Rico Tzschichholz 2017-01-17 13:30:40 UTC
Created attachment 343648 [details] [review]
Add some more query operations for Traversable<G>

* first_match (Predicate<G>) returns the first item that matches
* any_match (Predicate<G>) checks if any element matches
* all_match (Predicate<G>) checks if all elements match
* max/min returns max/min value
* order_by to perform ordering on any Traversable
Comment 2 Rico Tzschichholz 2017-01-29 21:18:55 UTC
Attachment 343648 [details] pushed as ed30714 - Add some more query operations for Traversable<G>