File indexing completed on 2024-04-21 05:41:32

0001 /*
0002     SPDX-FileCopyrightText: 2020 Milian Wolff <mail@milianw.de>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #include <src/util/linereader.h>
0008 
0009 #include <iostream>
0010 #include <sstream>
0011 #include <string>
0012 
0013 int main()
0014 {
0015     std::string contents;
0016     contents.reserve(5400000);
0017     for (int i = 0; i < 100000; ++i) {
0018         contents.append("0 1 2 3\n");
0019         contents.append("102 345 678 9ab\n");
0020         contents.append("102345 6789ab cdef01 23456789\n");
0021     }
0022 
0023     uint64_t ret = 0;
0024     for (int i = 0; i < 1000; ++i) {
0025         std::istringstream in(contents);
0026         LineReader reader;
0027         while (reader.getLine(in)) {
0028             uint64_t hex;
0029             while (reader.readHex(hex)) {
0030                 ret += hex;
0031             }
0032         }
0033     }
0034 
0035     std::cout << ret << '\n';
0036     return 0;
0037 }