<commit_before>#include "bytecode.h"

Bytecode::Bytecode(const std::vector<unsigned char> &obj)
{
    unsigned int strtablesize = (obj[0] << 8) | obj[1];
    strtable = getstrtable(obj.begin() + 2, obj.begin() + 2 + strtablesize);
    code = bytecode(obj.begin() + 2 + strtablesize, obj.end());
}

std::vector<std::string> Bytecode::getstrtable(bytecode::const_iterator start, bytecode::const_iterator end)
{
    std::vector<std::string> r;
    while (start != end) {
        std::string s;
        while (*start != 0) {
            s.push_back(*start);
            ++start;
        }
        r.push_back(s);
        ++start;
    }
    return r;
}<commit_msg>initialise members<commit_after>#include "bytecode.h"

Bytecode::Bytecode(const std::vector<unsigned char> &obj)
  : strtable(),
    code()
{
    unsigned int strtablesize = (obj[0] << 8) | obj[1];
    strtable = getstrtable(obj.begin() + 2, obj.begin() + 2 + strtablesize);
    code = bytecode(obj.begin() + 2 + strtablesize, obj.end());
}

std::vector<std::string> Bytecode::getstrtable(bytecode::const_iterator start, bytecode::const_iterator end)
{
    std::vector<std::string> r;
    while (start != end) {
        std::string s;
        while (*start != 0) {
            s.push_back(*start);
            ++start;
        }
        r.push_back(s);
        ++start;
    }
    return r;
}
{'fraction_non_alphanumeric': 0.17037037037037037, 'fraction_numerical': 0.01037037037037037, 'mean_word_length': 2.9852507374631267, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '2298633', 'n_tokens_mistral': 471, 'n_tokens_neox': 459, 'n_words': 91}