Skip to content

Commit dbc828b

Browse files
committed
style: address Copilot review feedback
- Clarify comment: random number range is [0, totalWeight) exclusive - Rename test: "fair distribution" → "be able to select both" (we test reachability, not statistical distribution)
1 parent 0aa407b commit dbc828b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/streaming/utils/baseUrlResolution/DVBSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ function DVBSelector(config) {
110110
cumulWeights.push(totalWeight);
111111
});
112112

113-
// pick a random number between zero and totalWeight
113+
// pick a random number between zero (inclusive) and totalWeight (exclusive)
114114
rn = Math.floor(Math.random() * totalWeight);
115115

116116
// select the index for the range rn falls within

test/unit/test/streaming/streaming.utils.DVBSelector.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ describe('BaseURLResolution/DVBSelector', function () {
158158
stub.restore();
159159
});
160160

161-
it('should select all equal-weight baseUrls with fair distribution (RFC 2782)', () => {
161+
it('should be able to select both equal-weight baseUrls (RFC 2782)', () => {
162162
const baseUrls = [
163163
{ dvbPriority: 1, dvbWeight: 1, serviceLocation: 'cdn-a' },
164164
{ dvbPriority: 1, dvbWeight: 1, serviceLocation: 'cdn-b' }

0 commit comments

Comments
 (0)