HomeDevCentral

Allow to get first item of a collection

This commit has been deleted in the repository: it is no longer reachable from any branch, tag, or ref.

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 19 2023, 23:14
Reviewer
dereckson
Differential Revision
D3197: Allow to get first item of a collection
Parents
rKOT70f15da8cf0d: Detect BSD as current OS
Branches
Unknown
Tags
Unknown