<commit_before>module.exports = createMap;


function createMap() {
    var keys = [],
        values = [];

    return {
        get: function(key) {
            return getValue(key, keys, values);
        },
        set: function(key, value) {
            var index = getIndex(key, keys);

            if (index !== -1) {
                values[index] = value;
            } else {
                index = keys.length;

                keys[index] = key;
                values[index] = value;
            }
        },
        has: function(key) {
            return getIndex(key, keys) !== -1;
        },
        remove: function(key) {
            var index = getIndex(key, keys);

            if (index !== -1) {
                keys.splice(index, 1);
                values.splice(index, 1);

                return true;
            }

            return false;
        },
        keys: function() {
            return copyArray(keys);
        },
        values: function() {
            return copyArray(values);
        },
        key: function(index) {

            return keys[index];
        },
        value: function(index) {

            return getValue(keys[index], keys, values);
        },
        size: function() {
            return keys.length;
        },
        clear: function() {
            keys.length = 0;
            values.length = 0;
        }
    };
}

function getValue(key, keys, values) {
    var index = getIndex(key, keys);

    return index !== -1 ? values[index] : undefined;
}

function getIndex(key, keys) {
    var i = keys.length;

    while (i--) {
        if (isEqual(key, keys[i])) {
            return i;
        }
    }

    return -1;
}

function isEqual(a, b) {
    return a === b || (a !== a && b !== b);
}

function copyArray(array) {
    var i = array.length,
        result = new Array(i);

    while (i--) {
        result[i] = array[i];
    }
    return result;
}
global.copyArray = copyArray;<commit_msg>updates<commit_after>module.exports = createMap;


function createMap() {
    var keys = [],
        values = [];

    return {
        get: function(key) {
            return getValue(key, keys, values);
        },
        set: function(key, value) {
            var index = getIndex(key, keys);

            if (index !== -1) {
                values[index] = value;
            } else {
                index = keys.length;

                keys[index] = key;
                values[index] = value;
            }
        },
        has: function(key) {
            return getIndex(key, keys) !== -1;
        },
        remove: function(key) {
            var index = getIndex(key, keys);

            if (index !== -1) {
                keys.splice(index, 1);
                values.splice(index, 1);

                return true;
            }

            return false;
        },
        keys: function() {
            return copyArray(keys);
        },
        values: function() {
            return copyArray(values);
        },
        key: function(index) {

            return keys[index];
        },
        value: function(index) {

            return getValue(keys[index], keys, values);
        },
        size: function() {
            return keys.length;
        },
        clear: function() {
            keys.length = 0;
            values.length = 0;
        }
    };
}

function getValue(key, keys, values) {
    var index = getIndex(key, keys);

    return index !== -1 ? values[index] : undefined;
}

function getIndex(key, keys) {
    var i = keys.length;

    while (i--) {
        if (isEqual(key, keys[i])) {
            return i;
        }
    }

    return -1;
}

function isEqual(a, b) {
    return !(a !== b && (a === a || b === b));
}

function copyArray(array) {
    var i = array.length,
        result = new Array(i);

    while (i--) {
        result[i] = array[i];
    }
    return result;
}
{'fraction_non_alphanumeric': 0.13723978411719354, 'fraction_numerical': 0.004626060138781804, 'mean_word_length': 1.3431667670078267, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5059508', 'n_tokens_mistral': 1160, 'n_tokens_neox': 1115, 'n_words': 273}