<commit_before>#pragma once
#include "common.h"

namespace swift_snails {

class Vec {
public:
    typedef double value_type;

    Vec() {
    }

    ~Vec() {
        if(_data != NULL) delete _data;
    }

    Vec(size_t size) {
        init(size);
    }

    Vec(const Vec& other) {
        if(_size != other.size()) {
            if(_data) {
                delete _data;
                _data = NULL;
                _size = 0;
            }
            init(other.size());
        }
        for(size_t i = 0; i < size(); i++) {
            data()[i] = other[i];
        }
    }

    Vec(Vec&& other) {
        _data = other._data;
        _size = other._size;
        other._data = NULL;
        other._size = 0;
    }

    Vec& operator= (const Vec& other) {
        if(this != &other) {
            _size = other.size(); <commit_msg>fix std::move memory leak in vec1<commit_after>#pragma once
#include "common.h"

namespace swift_snails {

class Vec {
public:
    typedef double value_type;

    Vec() {
    }

    ~Vec() {
        if(_data != NULL) delete _data;
    }

    Vec(size_t size) {
        init(size);
    }

    Vec(const Vec& other) {
        if(_size != other.size()) {
            if(_data) {
                delete _data;
                _data = NULL;
                _size = 0;
            }
            init(other.size());
        }
        for(size_t i = 0; i < size(); i++) {
            data()[i] = other[i];
        }
    }

    Vec(Vec&& other) {
        if(_data != NULL) {
            delete _data;
            _data = NULL;
        }
        _data = other._data;
        _size = other._size;
        other._data = NULL;
        other._size = 0;
    }

    Vec& operator= (const Vec& other) {
        if(this != &other) {
            _size = other.size(); 
{'fraction_non_alphanumeric': 0.13702460850111856, 'fraction_numerical': 0.0039149888143176735, 'mean_word_length': 1.3416230366492146, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '3989224', 'n_tokens_mistral': 591, 'n_tokens_neox': 566, 'n_words': 133}