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

#include "util.h"

void swap(int*a, int i, int j) {
    int tmp = a[i];
    a[i] = a[j];
    a[j] = tmp;
}

int* sort_bubble(int* a, int n) {
    if (a == NULL || n == 0) {
        return NULL;
    }

    if (n == 1) {
        return a;
    }

    int limit;
    int sorted_since;
    for (limit=n; limit>1; limit--) {
        sorted_since = -1;
        int i;
        for (i=1; i<limit; i++) {
            if (a[i] < a[i-1]) {
                swap(a, i, i-1);
                sorted_since = -1;
            } else if (sorted_since == -1) {<commit_msg>clean bubble<commit_after>void swap(int*a, int i, int j) {
    int tmp = a[i];
    a[i] = a[j];
    a[j] = tmp;
}

int* sort_bubble(int* a, int n) {
    if (!a || n == 0) {
        return 0;
    }

    if (n == 1) {
        return a;
    }

    int limit;
    int sorted_since;
    for (limit=n; limit>1; limit--) {
        sorted_since = -1;
        int i;
        for (i=1; i<limit; i++) {
            if (a[i] < a[i-1]) {
                swap(a, i, i-1);
                sorted_since = -1;
            } else if (sorted_since == -1) {
{'fraction_non_alphanumeric': 0.1791958041958042, 'fraction_numerical': 0.016608391608391608, 'mean_word_length': 1.4730021598272138, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '3337506', 'n_tokens_mistral': 473, 'n_tokens_neox': 463, 'n_words': 122}