Skip to content

Commit 345429d

Browse files
KoolDripkgryte
andauthored
chore: fix JavaScript lint errors
PR-URL: stdlib-js#8220 Closes: stdlib-js#8200 Co-authored-by: Athan Reines <[email protected]> Reviewed-by: Athan Reines <[email protected]>
1 parent 3000a12 commit 345429d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

lib/node_modules/@stdlib/constants/float32/ninf/lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* @example
2828
* var FLOAT32_NINF = require( '@stdlib/constants/float32/ninf' );
29-
* // returns -infinity
29+
* // returns -Infinity
3030
*/
3131

3232
// MODULES //

lib/node_modules/@stdlib/random/sample/lib/renormalizing.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818

1919
'use strict';
2020

21+
// MODULES //
22+
23+
var copy = require( '@stdlib/array/base/copy' );
24+
25+
26+
// MAIN //
27+
2128
/**
2229
* Samples without replacement from a discrete set using custom probabilities.
2330
*
@@ -43,11 +50,9 @@ function renormalizing( x, size, rand, probabilities ) {
4350
var u;
4451

4552
N = x.length;
46-
probs = new Array( N );
47-
for ( i = 0; i < N; i++ ) {
48-
probs[ i ] = probabilities[ i ];
49-
}
50-
out = new Array( size );
53+
probs = copy( probabilities );
54+
55+
out = [];
5156
for ( i = 0; i < size; i++ ) {
5257
u = rand();
5358
psum = 0;
@@ -64,7 +69,7 @@ function renormalizing( x, size, rand, probabilities ) {
6469
probs[ k ] /= 1.0 - probs[ j ];
6570
}
6671
probs[ j ] = 0.0;
67-
out[ i ] = x[ j ];
72+
out.push( x[ j ] );
6873
}
6974
return out;
7075
}

0 commit comments

Comments
 (0)