File tree 1 file changed +7
-1
lines changed
lib/node_modules/@stdlib/iter/any/benchmark
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ function createIterator( arr ) {
38
38
39
39
it = { } ;
40
40
it . next = next ;
41
+ it . reset = reset ;
41
42
42
43
return it ;
43
44
@@ -49,11 +50,14 @@ function createIterator( arr ) {
49
50
'done' : false
50
51
} ;
51
52
}
52
- i = - 1 ; // reset index
53
53
return {
54
54
'done' : true
55
55
} ;
56
56
}
57
+
58
+ function reset ( ) {
59
+ i = - 1 ;
60
+ }
57
61
}
58
62
59
63
@@ -72,6 +76,7 @@ bench( pkg, function benchmark( b ) {
72
76
if ( ! isBoolean ( bool ) ) {
73
77
b . fail ( 'should return a boolean' ) ;
74
78
}
79
+ arr . reset ( ) ;
75
80
}
76
81
b . toc ( ) ;
77
82
if ( ! isBoolean ( bool ) ) {
@@ -103,6 +108,7 @@ bench( pkg+'::loop', function benchmark( b ) {
103
108
if ( ! isBoolean ( bool ) ) {
104
109
b . fail ( 'should be a boolean' ) ;
105
110
}
111
+ arr . reset ( ) ;
106
112
}
107
113
b . toc ( ) ;
108
114
if ( ! isBoolean ( bool ) ) {
You can’t perform that action at this time.
0 commit comments