<commit_before>#pragma once
#include <string.h>

#include <carp_memory.h>
#include <core.h>

void String_delete(String s) {
    CARP_FREE(s);
}

void String_string_MINUS_set_BANG_(String *s, int i, char ch) {
    (*s)[i] = ch;
}

String String_copy(String *s) {
    size_t len = strlen(*s) + 1;
    String ptr = CARP_MALLOC(len);

    if (ptr == NULL) {
      return NULL;
    }

    return (String) memcpy(ptr, *s, len);
}

bool String__EQ_(String *a, String *b) {
    return strcmp(*a, *b) == 0;
}
<commit_msg>Adding asserts to String.string-set!<commit_after>#pragma once
#include <string.h>

#include <carp_memory.h>
#include <core.h>

void String_delete(String s) {
    CARP_FREE(s);
}

void String_string_MINUS_set_BANG_(String *s, int i, char ch) {
#ifndef OPTIMIZE
    int l = strlen(*s);
    assert(i >= 0);
    assert(i < l);
#endif
    (*s)[i] = ch;
}

String String_copy(String *s) {
    size_t len = strlen(*s) + 1;
    String ptr = CARP_MALLOC(len);

    if (ptr == NULL) {
      return NULL;
    }

    return (String) memcpy(ptr, *s, len);
}

bool String__EQ_(String *a, String *b) {
    return strcmp(*a, *b) == 0;
}

{'fraction_non_alphanumeric': 0.16137566137566137, 'fraction_numerical': 0.004409171075837742, 'mean_word_length': 3.382239382239382, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '7203944', 'n_tokens_mistral': 469, 'n_tokens_neox': 454, 'n_words': 113}