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