HomeDevCentral

Implement a weighted list

Description

Implement a weighted list

Summary:
A weighted value is a pair defined by a value, and an associated weight.

A weighted list is a collection of weight values.

This change allows to create a list of items, with an associated weight.

A use case is to parse $_SERVER['HTTP_ACCEPT_LANGUAGE'], a list of
languages, with associated weight to indicate user preferences of
languages with more granularity.

Test Plan:

  • Unit tests provided
  • The next commit will implement this for AcceptedLanguages

Reviewers: dereckson

Reviewed By: dereckson

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

Details

Provenance
derecksonAuthored on Apr 30 2018, 10:27
derecksonPushed on Feb 19 2022, 22:15
Parents
rKERUALD1ff97192a439: Allow to count "null" and "false" values
Branches
Unknown
Tags
Unknown

Event Timeline