<commit_before>#pragma once
//License: Public Domain
//Author: elf
//EMail: <EMAIL>

#include "List.h"

typedef struct{
    elf_List list;
    MU nCount;
}elf_CountedList;

static inline void elf_CountedList_Reset(elf_CountedList *pList){
    elf_List_Reset((elf_List*)pList);
    pList->nCount = 0;
}

static inline void elf_CountedList_Initialize(elf_CountedList *pList){
    elf_CountedList_Reset(pList);
}

static inline Bool elf_CountedList_Empty(const elf_CountedList *pList){
    return elf_List_Empty((elf_List*)pList);
}

static inline Bool elf_CountedList_NotEmpty(const elf_CountedList *pList){
    return elf_List_NotEmpty((elf_List*)pList);
}

static inline Bool elf_CountedList_First(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_First((elf_List*)pList, pNode);
}

static inline Bool elf_CountedList_NotFirst(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_NotFirst((elf_List*)pList, pNode);
}

static inline Bool elf_CountedList_Last(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_Last((elf_List*)pList, pNode);
}

static inline Bool elf_CountedList_NotLast(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_NotLast((elf_List*)pList, pNode);
}

static inline void elf_CountedList_Insert(elf_CountedList *pList, elf_DoubleNode *pNode, elf_DoubleNode *pPrev, elf_DoubleNode *pNext){
    elf_List_Insert(pNode, pPrev, pNext);
    ++pList->nCount;
}

static inline void elf_CountedList_Remove(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_Remove(pNode);
    --pList->nCount;
}

//push back
static inline void elf_CountedList_Push(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_Push((elf_List*)pList, pNode);
    ++pList->nCount;
}

//pop front
static inline elf_DoubleNode *elf_CountedList_Pop(elf_CountedList *pList){
    elf_DoubleNode *pNode = elf_List_Pop((elf_List*)pList);
    --pList->nCount;
    return pNode;
}

static inline void elf_CountedList_PushFront(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_PushFront((elf_List*)pList, pNode);
    ++pList->nCount;
}

static inline elf_DoubleNode *CountedList_PopBack(elf_CountedList *pList){
    elf_DoubleNode *pNode = elf_List_PopBack((elf_List*)pList);
    --pList->nCount;
    return pNode;
}

static inline void elf_CountedList_MoveNodeToFront(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_Remove(pNode);
    elf_List_PushFront((elf_List*)pList, pNode);
}
//move to back
static inline void elf_CountedList_MoveTo(elf_CountedList *pList, elf_CountedList *pTargetList){
    elf_List_MoveTo((elf_List*)pList, (elf_List*)pTargetList);
    pTargetList->nCount += pList->nCount;
    pList->nCount = 0;
}

static inline void elf_CountedList_MoveToFront(elf_CountedList *pList, elf_CountedList *pTargetList){
    elf_List_MoveToFront((elf_List*)pList, (elf_List*)pTargetList);
    pTargetList->nCount += pList->nCount;
    pList->nCount = 0;
}

static inline void elf_CountedList_Swap(elf_CountedList *pList, elf_CountedList *pTargetList){
    elf_List_Swap ((elf_List*)pList, (elf_List*)pTargetList);
    MU nTmp = pList->nCount;
    pList->nCount = pTargetList->nCount;
    pTargetList->nCount = nTmp;
}
<commit_msg>Simply elf_CountedList_MoveNodeToFront<commit_after>#pragma once
//License: Public Domain
//Author: elf
//EMail: <EMAIL>

#include "List.h"

typedef struct{
    elf_List list;
    MU nCount;
}elf_CountedList;

static inline void elf_CountedList_Reset(elf_CountedList *pList){
    elf_List_Reset((elf_List*)pList);
    pList->nCount = 0;
}

static inline void elf_CountedList_Initialize(elf_CountedList *pList){
    elf_CountedList_Reset(pList);
}

static inline Bool elf_CountedList_Empty(const elf_CountedList *pList){
    return elf_List_Empty((elf_List*)pList);
}

static inline Bool elf_CountedList_NotEmpty(const elf_CountedList *pList){
    return elf_List_NotEmpty((elf_List*)pList);
}

static inline Bool elf_CountedList_First(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_First((elf_List*)pList, pNode);
}

static inline Bool elf_CountedList_NotFirst(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_NotFirst((elf_List*)pList, pNode);
}

static inline Bool elf_CountedList_Last(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_Last((elf_List*)pList, pNode);
}

static inline Bool elf_CountedList_NotLast(const elf_CountedList *pList, const elf_DoubleNode *pNode){
    return elf_List_NotLast((elf_List*)pList, pNode);
}

static inline void elf_CountedList_Insert(elf_CountedList *pList, elf_DoubleNode *pNode, elf_DoubleNode *pPrev, elf_DoubleNode *pNext){
    elf_List_Insert(pNode, pPrev, pNext);
    ++pList->nCount;
}

static inline void elf_CountedList_Remove(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_Remove(pNode);
    --pList->nCount;
}

//push back
static inline void elf_CountedList_Push(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_Push((elf_List*)pList, pNode);
    ++pList->nCount;
}

//pop front
static inline elf_DoubleNode *elf_CountedList_Pop(elf_CountedList *pList){
    elf_DoubleNode *pNode = elf_List_Pop((elf_List*)pList);
    --pList->nCount;
    return pNode;
}

static inline void elf_CountedList_PushFront(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_PushFront((elf_List*)pList, pNode);
    ++pList->nCount;
}

static inline elf_DoubleNode *CountedList_PopBack(elf_CountedList *pList){
    elf_DoubleNode *pNode = elf_List_PopBack((elf_List*)pList);
    --pList->nCount;
    return pNode;
}

static inline void elf_CountedList_MoveNodeToFront(elf_CountedList *pList, elf_DoubleNode *pNode){
    elf_List_MoveNodeToFront((elf_List*)pList, pNode);
}
//move to back
static inline void elf_CountedList_MoveTo(elf_CountedList *pList, elf_CountedList *pTargetList){
    elf_List_MoveTo((elf_List*)pList, (elf_List*)pTargetList);
    pTargetList->nCount += pList->nCount;
    pList->nCount = 0;
}

static inline void elf_CountedList_MoveToFront(elf_CountedList *pList, elf_CountedList *pTargetList){
    elf_List_MoveToFront((elf_List*)pList, (elf_List*)pTargetList);
    pTargetList->nCount += pList->nCount;
    pList->nCount = 0;
}

static inline void elf_CountedList_Swap(elf_CountedList *pList, elf_CountedList *pTargetList){
    elf_List_Swap ((elf_List*)pList, (elf_List*)pTargetList);
    MU nTmp = pList->nCount;
    pList->nCount = pTargetList->nCount;
    pTargetList->nCount = nTmp;
}

{'fraction_non_alphanumeric': 0.10625286653416909, 'fraction_numerical': 0.0009172909341079345, 'mean_word_length': 6.244739756367664, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 39, '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': '3917630', 'n_tokens_mistral': 2393, 'n_tokens_neox': 2366, 'n_words': 444}