Page MenuHomeDevCentral

Implement a weighted list
ClosedPublic

Authored by dereckson on Apr 30 2018, 10:40.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Mar 27, 06:50
Unknown Object (File)
Wed, Mar 27, 06:49
Unknown Object (File)
Wed, Mar 27, 06:49
Unknown Object (File)
Wed, Mar 27, 05:02
Unknown Object (File)
Wed, Mar 27, 01:48
Unknown Object (File)
Sun, Mar 24, 14:52
Unknown Object (File)
Sat, Mar 23, 07:02
Unknown Object (File)
Fri, Mar 22, 07:50
Subscribers
None

Details

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

Diff Detail

Repository
rKOT Keruald OmniTools
Lint
Lint Passed
Unit
Tests Passed
Branch
AcceptedLanguages (branched from master)
Build Status
Buildable 2562
Build 2810: arc lint + arc unit

Event Timeline

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

Drop AcceptedLanguages class from this change

This revision was automatically updated to reflect the committed changes.