File tree Expand file tree Collapse file tree
lib/node_modules/@stdlib/array/filled/lib Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ var isFunction = require( '@stdlib/assert/is-function' );
2929var hasOwnProp = require ( '@stdlib/assert/has-own-property' ) ;
3030var ctors = require ( '@stdlib/array/ctors' ) ;
3131var gfill = require ( '@stdlib/blas/ext/base/gfill' ) ;
32+ var filled = require ( '@stdlib/array/base/filled' ) ;
3233var hasIteratorSymbolSupport = require ( '@stdlib/assert/has-iterator-symbol-support' ) ;
3334var ITERATOR_SYMBOL = require ( '@stdlib/symbol/iterator' ) ;
3435
@@ -40,26 +41,6 @@ var HAS_ITERATOR_SYMBOL = hasIteratorSymbolSupport();
4041
4142// FUNCTIONS //
4243
43- /**
44- * Creates a filled "generic" array.
45- *
46- * @private
47- * @param {NonNegativeInteger } len - array length
48- * @param {* } value - fill value
49- * @returns {Array } filled array
50- */
51- function filled ( len , value ) {
52- var arr ;
53- var i ;
54-
55- // Manually push elements in order to ensure "fast" elements...
56- arr = [ ] ;
57- for ( i = 0 ; i < len ; i ++ ) {
58- arr . push ( value ) ;
59- }
60- return arr ;
61- }
62-
6344/**
6445* Creates a filled "generic" array from an iterator.
6546*
@@ -211,7 +192,7 @@ function filledarray() {
211192 len = arg . length ;
212193 }
213194 if ( len !== void 0 ) {
214- return filled ( len , value ) ;
195+ return filled ( value , len ) ;
215196 }
216197 if ( isArrayBuffer ( arg ) ) {
217198 throw new Error ( 'invalid arguments. Creating a generic array from an ArrayBuffer is not supported.' ) ;
You can’t perform that action at this time.
0 commit comments