Implement a weighted list

Authored by dereckson on Apr 30 2018, 10:27.

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

Committed
derecksonApr 30 2018, 10:49
Pushed
derecksonApr 30 2018, 10:49
Reviewer
dereckson
Differential Revision
D1633: Implement a weighted list
Parents
rKOT1ff97192a439: Allow to count "null" and "false" values
Branches
Unknown
Tags
Unknown