Page MenuHomeDevCentral

Implement a weighted list

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



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

Diff Detail

rKOT Keruald OmniTools
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

dereckson requested review of this revision.Apr 30 2018, 10:40
dereckson created this revision.
dereckson updated this revision to Diff 4168.Apr 30 2018, 10:42

Whitespace issues

dereckson accepted this revision.Apr 30 2018, 10:47
dereckson edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Apr 30 2018, 10:47
dereckson updated this revision to Diff 4169.Apr 30 2018, 10:49

Drop AcceptedLanguages class from this change

This revision was automatically updated to reflect the committed changes.