Page MenuHomeDevCentral

Implement a weighted list
ClosedPublic

Authored by dereckson on Apr 30 2018, 10:40.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 17:49
Unknown Object (File)
Tue, Nov 12, 16:51
Unknown Object (File)
Tue, Nov 12, 12:02
Unknown Object (File)
Tue, Nov 12, 03:30
Unknown Object (File)
Sun, Nov 10, 14:04
Unknown Object (File)
Sun, Nov 10, 13:48
Unknown Object (File)
Sun, Nov 10, 13:23
Unknown Object (File)
Sun, Nov 10, 13:19
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.