@@ -23,7 +23,7 @@ static void numbers_scan(State& state) {
2323 cerr << " could not read " << NUMBERS_JSON << " as an array" << endl;
2424 return ;
2525 }
26- for (auto _ : state) {
26+ for (UNUSED auto _ : state) {
2727 std::vector<double > container;
2828 for (auto e : arr) {
2929 double x;
@@ -47,7 +47,7 @@ static void numbers_size_scan(State& state) {
4747 cerr << " could not read " << NUMBERS_JSON << " as an array" << endl;
4848 return ;
4949 }
50- for (auto _ : state) {
50+ for (UNUSED auto _ : state) {
5151 std::vector<double > container;
5252 container.resize (arr.size ());
5353 size_t pos = 0 ;
@@ -75,7 +75,7 @@ static void numbers_type_scan(State& state) {
7575 cerr << " could not read " << NUMBERS_JSON << " as an array" << endl;
7676 return ;
7777 }
78- for (auto _ : state) {
78+ for (UNUSED auto _ : state) {
7979 std::vector<double > container;
8080 for (auto e : arr) {
8181 dom::element_type actual_type = e.type ();
@@ -102,7 +102,7 @@ static void numbers_type_size_scan(State& state) {
102102 cerr << " could not read " << NUMBERS_JSON << " as an array" << endl;
103103 return ;
104104 }
105- for (auto _ : state) {
105+ for (UNUSED auto _ : state) {
106106 std::vector<double > container;
107107 container.resize (arr.size ());
108108 size_t pos = 0 ;
@@ -127,7 +127,7 @@ static void numbers_load_scan(State& state) {
127127 dom::parser parser;
128128 dom::array arr;
129129 simdjson::error_code error;
130- for (auto _ : state) {
130+ for (UNUSED auto _ : state) {
131131 // this may hit the disk, but probably just once
132132 parser.load (NUMBERS_JSON).get <dom::array>().tie (arr, error);
133133 if (error) {
@@ -152,7 +152,7 @@ static void numbers_load_size_scan(State& state) {
152152 dom::parser parser;
153153 dom::array arr;
154154 simdjson::error_code error;
155- for (auto _ : state) {
155+ for (UNUSED auto _ : state) {
156156 // this may hit the disk, but probably just once
157157 parser.load (NUMBERS_JSON).get <dom::array>().tie (arr, error);
158158 if (error) {
@@ -183,7 +183,7 @@ static void numbers_exceptions_scan(State& state) {
183183 // Prints the number of results in twitter.json
184184 dom::parser parser;
185185 dom::array arr = parser.load (NUMBERS_JSON);
186- for (auto _ : state) {
186+ for (UNUSED auto _ : state) {
187187 std::vector<double > container;
188188 for (double x : arr) {
189189 container.push_back (x);
@@ -198,7 +198,7 @@ static void numbers_exceptions_size_scan(State& state) {
198198 // Prints the number of results in twitter.json
199199 dom::parser parser;
200200 dom::array arr = parser.load (NUMBERS_JSON);
201- for (auto _ : state) {
201+ for (UNUSED auto _ : state) {
202202 std::vector<double > container;
203203 container.resize (arr.size ());
204204 size_t pos = 0 ;
@@ -218,7 +218,7 @@ static void numbers_type_exceptions_scan(State& state) {
218218 // Prints the number of results in twitter.json
219219 dom::parser parser;
220220 dom::array arr = parser.load (NUMBERS_JSON);
221- for (auto _ : state) {
221+ for (UNUSED auto _ : state) {
222222 std::vector<double > container;
223223 for (auto e : arr) {
224224 dom::element_type actual_type = e.type ();
@@ -237,7 +237,7 @@ static void numbers_type_exceptions_size_scan(State& state) {
237237 // Prints the number of results in twitter.json
238238 dom::parser parser;
239239 dom::array arr = parser.load (NUMBERS_JSON);
240- for (auto _ : state) {
240+ for (UNUSED auto _ : state) {
241241 std::vector<double > container;
242242 container.resize (arr.size ());
243243 size_t pos = 0 ;
@@ -258,7 +258,7 @@ BENCHMARK(numbers_type_exceptions_size_scan);
258258static void numbers_exceptions_load_scan (State& state) {
259259 // Prints the number of results in twitter.json
260260 dom::parser parser;
261- for (auto _ : state) {
261+ for (UNUSED auto _ : state) {
262262 // this may hit the disk, but probably just once
263263 dom::array arr = parser.load (NUMBERS_JSON);
264264 std::vector<double > container;
@@ -274,7 +274,7 @@ BENCHMARK(numbers_exceptions_load_scan);
274274static void numbers_exceptions_load_size_scan (State& state) {
275275 // Prints the number of results in twitter.json
276276 dom::parser parser;
277- for (auto _ : state) {
277+ for (UNUSED auto _ : state) {
278278 // this may hit the disk, but probably just once
279279 dom::array arr = parser.load (NUMBERS_JSON);
280280 std::vector<double > container;
@@ -295,7 +295,7 @@ static void twitter_count(State& state) {
295295 // Prints the number of results in twitter.json
296296 dom::parser parser;
297297 dom::element doc = parser.load (TWITTER_JSON);
298- for (auto _ : state) {
298+ for (UNUSED auto _ : state) {
299299 uint64_t result_count = doc[" search_metadata" ][" count" ];
300300 if (result_count != 100 ) { return ; }
301301 }
@@ -308,7 +308,7 @@ static void iterator_twitter_count(State& state) {
308308 // Prints the number of results in twitter.json
309309 padded_string json = padded_string::load (TWITTER_JSON);
310310 ParsedJson pj = build_parsed_json (json);
311- for (auto _ : state) {
311+ for (UNUSED auto _ : state) {
312312 ParsedJson::Iterator iter (pj);
313313 // uint64_t result_count = doc["search_metadata"]["count"];
314314 if (!iter.move_to_key (" search_metadata" )) { return ; }
@@ -326,7 +326,7 @@ static void twitter_default_profile(State& state) {
326326 // Count unique users with a default profile.
327327 dom::parser parser;
328328 dom::element doc = parser.load (TWITTER_JSON);
329- for (auto _ : state) {
329+ for (UNUSED auto _ : state) {
330330 set<string_view> default_users;
331331 for (dom::object tweet : doc[" statuses" ].get <dom::array>()) {
332332 dom::object user = tweet[" user" ];
@@ -343,7 +343,7 @@ static void twitter_image_sizes(State& state) {
343343 // Count unique image sizes
344344 dom::parser parser;
345345 dom::element doc = parser.load (TWITTER_JSON);
346- for (auto _ : state) {
346+ for (UNUSED auto _ : state) {
347347 set<tuple<uint64_t , uint64_t >> image_sizes;
348348 for (dom::object tweet : doc[" statuses" ].get <dom::array>()) {
349349 auto [media, not_found] = tweet[" entities" ][" media" ];
@@ -366,7 +366,7 @@ static void error_code_twitter_count(State& state) noexcept {
366366 // Prints the number of results in twitter.json
367367 dom::parser parser;
368368 dom::element doc = parser.load (TWITTER_JSON);
369- for (auto _ : state) {
369+ for (UNUSED auto _ : state) {
370370 auto [value, error] = doc[" search_metadata" ][" count" ].get <uint64_t >();
371371 if (error) { return ; }
372372 if (value != 100 ) { return ; }
@@ -378,7 +378,7 @@ static void error_code_twitter_default_profile(State& state) noexcept {
378378 // Count unique users with a default profile.
379379 dom::parser parser;
380380 dom::element doc = parser.load (TWITTER_JSON);
381- for (auto _ : state) {
381+ for (UNUSED auto _ : state) {
382382 set<string_view> default_users;
383383
384384 auto [tweets, error] = doc[" statuses" ].get <dom::array>();
@@ -406,7 +406,7 @@ static void iterator_twitter_default_profile(State& state) {
406406 // Count unique users with a default profile.
407407 padded_string json = padded_string::load (TWITTER_JSON);
408408 ParsedJson pj = build_parsed_json (json);
409- for (auto _ : state) {
409+ for (UNUSED auto _ : state) {
410410 set<string_view> default_users;
411411 ParsedJson::Iterator iter (pj);
412412
@@ -445,7 +445,7 @@ static void error_code_twitter_image_sizes(State& state) noexcept {
445445 // Count unique image sizes
446446 dom::parser parser;
447447 dom::element doc = parser.load (TWITTER_JSON);
448- for (auto _ : state) {
448+ for (UNUSED auto _ : state) {
449449 set<tuple<uint64_t , uint64_t >> image_sizes;
450450 auto [statuses, error] = doc[" statuses" ].get <dom::array>();
451451 if (error) { return ; }
@@ -475,7 +475,7 @@ static void iterator_twitter_image_sizes(State& state) {
475475 // Count unique image sizes
476476 padded_string json = padded_string::load (TWITTER_JSON);
477477 ParsedJson pj = build_parsed_json (json);
478- for (auto _ : state) {
478+ for (UNUSED auto _ : state) {
479479 set<tuple<uint64_t , uint64_t >> image_sizes;
480480 ParsedJson::Iterator iter (pj);
481481
@@ -534,7 +534,7 @@ static void print_json(State& state) noexcept {
534534 padded_string json = get_corpus (TWITTER_JSON);
535535 dom::parser parser;
536536 if (int error = json_parse (json, parser); error != SUCCESS) { cerr << error_message (error) << endl; return ; }
537- for (auto _ : state) {
537+ for (UNUSED auto _ : state) {
538538 std::stringstream s;
539539 if (!parser.print_json (s)) { cerr << " print_json failed" << endl; return ; }
540540 }
0 commit comments