<commit_before>/**
 * @file lists.c
 * @brief List management system implementation.
 */

exception insert_readyList(listobj* elmt) {
    listobj* current = readyList->pHead;

    if(readyList->pHead == readyList->pTail == NULL) { // If empty list
        readyList->pHead = elmt;
        readyList->pTail = elmt;
        return OK;
    }
    while(current->pNext != NULL) { // Until we reach the end of the list
        if(elmt->pTask->DeadLine < current->pTask->DeadLine) {
            current->pPrevious->pNext = elmt;
            elmt->pPrevious = current->pPrevious;
            current->pPrevious = elmt;
            elmt.pNext = current;
            return OK;
        }
        current = current->pNext;
    }
    current->pNext = elmt;
    elmt->pPrevious = current;
    return OK;
}<commit_msg>Definition of extract_readyList<commit_after>/**
 * @file lists.c
 * @brief List management system implementation.
 */

exception insert_readyList(listobj* elmt) {
    listobj* current = readyList->pHead;

    if(readyList->pHead == readyList->pTail == NULL) { // If empty list
        readyList->pHead = elmt;
        readyList->pTail = elmt;
        return OK;
    }
    while(current->pNext != NULL) { // Until we reach the end of the list
        if(elmt->pTask->DeadLine < current->pTask->DeadLine) {
            current->pPrevious->pNext = elmt;
            elmt->pPrevious = current->pPrevious;
            current->pPrevious = elmt;
            elmt.pNext = current;
            return OK;
        }
        current = current->pNext;
    }
    current->pNext = elmt;
    elmt->pPrevious = current;
    return OK;
}

listobj* extract_readyList(void) {
    listobj* first = readyList->pHead;
    first->pNext->pPrevious = NULL;
    readyList->pHead = first->pNext;
    firs->pNext = NULL;
    return first;
}
{'fraction_non_alphanumeric': 0.12816281628162815, 'fraction_numerical': 0.0, 'mean_word_length': 2.265709156193896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 45, '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': '2151395', 'n_tokens_mistral': 568, 'n_tokens_neox': 564, 'n_words': 127}