HomeDevCentral

Allow to map Vector elements into HashMap

Description

Allow to map Vector elements into HashMap

Summary:
Callback must return an array of exactly two elements:
[key, value]

It can takes in parameter ($value) or ($key, $value).

This array is used to build a HashMap with at most the
same number of elements than the vector.

If several identical keys are returned by the different
callback executions, the last value is kept.

This is the reverse operation from D3214.

Test Plan: Unit tests are provided.

Reviewers: dereckson

Reviewed By: dereckson

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

Details

Provenance
derecksonAuthored on Jul 1 2023, 18:51
derecksonPushed on Jul 1 2023, 19:06
Reviewer
dereckson
Differential Revision
D3217: Allow to map Vector elements into HashMap
Parents
rKERUALDe2cfd5d0609e: Build a new instance from CodeClass from an existing object
Branches
Unknown
Tags
Unknown
References
tag: omnitools/0.10.1