Skip to content

Commit 4d84bbd

Browse files
committed
Update benchmarks
1 parent 01ad0e6 commit 4d84bbd

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/node_modules/@stdlib/iter/any/benchmark/benchmark.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ function createIterator( arr ) {
3838

3939
it = {};
4040
it.next = next;
41+
it.reset = reset;
4142

4243
return it;
4344

@@ -49,11 +50,14 @@ function createIterator( arr ) {
4950
'done': false
5051
};
5152
}
52-
i = -1; // reset index
5353
return {
5454
'done': true
5555
};
5656
}
57+
58+
function reset() {
59+
i = -1;
60+
}
5761
}
5862

5963

@@ -72,6 +76,7 @@ bench( pkg, function benchmark( b ) {
7276
if ( !isBoolean( bool ) ) {
7377
b.fail( 'should return a boolean' );
7478
}
79+
arr.reset();
7580
}
7681
b.toc();
7782
if ( !isBoolean( bool ) ) {
@@ -103,6 +108,7 @@ bench( pkg+'::loop', function benchmark( b ) {
103108
if ( !isBoolean( bool ) ) {
104109
b.fail( 'should be a boolean' );
105110
}
111+
arr.reset();
106112
}
107113
b.toc();
108114
if ( !isBoolean( bool ) ) {

0 commit comments

Comments
 (0)