HomeDevCentral

Allow to get first item of a collection

Description

Allow to get first item of a collection

Summary:
This changes add to BaseCollection classes the following methods:

  • first() will return the first item if it exists
  • firstOr() will return the first item if it exists, or a default value if not.

Both are implemented by the WithCollection trait.

Test Plan: Tested in Zed

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D3197

Details

Provenance
derecksonAuthored on Jun 14 2023, 18:39
derecksonPushed on Jun 14 2023, 21:16
Reviewer
dereckson
Differential Revision
D3197: Allow to get first item of a collection
Parents
rKERUALD831a0963ff41: Detect BSD as current OS
Branches
Unknown
Tags
Unknown
References
tag: omnitools/0.8.0