File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,7 @@ fn bench_contains_short_short(b: &mut Bencher) {
123
123
let needle = "sit" ;
124
124
125
125
b. iter ( || {
126
- assert ! ( haystack. contains( needle) ) ;
126
+ assert ! ( black_box ( haystack) . contains( black_box ( needle) ) ) ;
127
127
} )
128
128
}
129
129
@@ -167,7 +167,7 @@ malesuada sollicitudin quam eu fermentum.";
167
167
let needle = "english" ;
168
168
169
169
b. iter ( || {
170
- assert ! ( !haystack. contains( needle) ) ;
170
+ assert ! ( !black_box ( haystack) . contains( black_box ( needle) ) ) ;
171
171
} )
172
172
}
173
173
@@ -177,7 +177,7 @@ fn bench_contains_bad_naive(b: &mut Bencher) {
177
177
let needle = "aaaaaaaab" ;
178
178
179
179
b. iter ( || {
180
- assert ! ( !haystack. contains( needle) ) ;
180
+ assert ! ( !black_box ( haystack) . contains( black_box ( needle) ) ) ;
181
181
} )
182
182
}
183
183
@@ -187,7 +187,7 @@ fn bench_contains_equal(b: &mut Bencher) {
187
187
let needle = "Lorem ipsum dolor sit amet, consectetur adipiscing elit." ;
188
188
189
189
b. iter ( || {
190
- assert ! ( haystack. contains( needle) ) ;
190
+ assert ! ( black_box ( haystack) . contains( black_box ( needle) ) ) ;
191
191
} )
192
192
}
193
193
You can’t perform that action at this time.
0 commit comments