<commit_before>#include <SDL_cpuinfo.h>

#include <time.h> // time_t, time
#include <float.h>
#include <limits.h>

#include "u_misc.h"
#include "u_memory.h" // unique_ptr

namespace u {
namespace detail {
#if defined(_WIN32)
    // Performs replacements on the format string into ones understood
    // by MSVCRT.
    u::string fixFormatString(const char *format) {
        u::string replace(format);
        struct { const char *find, *replace; } replacements[] = {
            { "%zd", "%Id" },
            { "%zi", "%Ii" },
            { "%zo", "%Io" },
            { "%zu", "%Iu" },
            { "%zx", "%Ix" }
        };
        for (const auto &it : replacements)
            replace.replace_all(it.find, it.replace);
        return replace;
    }
#endif<commit_msg>fixFormatString using static const table of replacements<commit_after>#include <SDL_cpuinfo.h>

#include <time.h> // time_t, time
#include <float.h>
#include <limits.h>

#include "u_misc.h"
#include "u_memory.h" // unique_ptr

namespace u {
namespace detail {
#if defined(_WIN32)
    // Performs replacements on the format string into ones understood
    // by MSVCRT.
    u::string fixFormatString(const char *format) {
        u::string replace(format);
        static const struct { const char *find, *replace; } kReplacements[] = {
            { "%zd", "%Id" },
            { "%zi", "%Ii" },
            { "%zo", "%Io" },
            { "%zu", "%Iu" },
            { "%zx", "%Ix" }
        };
        for (const auto &it : kReplacements)
            replace.replace_all(it.find, it.replace);
        return replace;
    }
#endif
{'fraction_non_alphanumeric': 0.1596009975062344, 'fraction_numerical': 0.0024937655860349127, 'mean_word_length': 2.3367983367983367, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '42468', 'n_tokens_mistral': 531, 'n_tokens_neox': 512, 'n_words': 135}