<commit_before>#include <stdlib.h>
#include <stdbool.h>

#include "string.h"

bool
string_init(struct string* s, size_t size, size_t growby)
{
    s->length = 0;
    s->s = malloc(size);
    if (!s->s) {
        s->size = 0;
        s->growby = growby;
    } else {
        memset(s->s, 0, size);
        s->size = size;
        s->growby = growby;
    }
    return true;
}
<commit_msg>string_init(): init growby structure member only once<commit_after>#include <stdlib.h>
#include <stdbool.h>

#include "string.h"

bool
string_init(struct string* s, size_t size, size_t growby)
{
    s->length = 0;
    s->growby = growby;
    s->s = malloc(size);
    if (s->s == NULL) {
        s->size = 0;
    } else {
        memset(s->s, 0, size);
        s->size = size;
    }
    return true;
}

{'fraction_non_alphanumeric': 0.16518424396442186, 'fraction_numerical': 0.007623888182973317, 'mean_word_length': 2.297071129707113, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 22, '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': '312958', 'n_tokens_mistral': 317, 'n_tokens_neox': 306, 'n_words': 73}