<commit_before>var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;
var db = null;


function cache(id, data) {
    var request = indexedDB.open("cache", 1);
    request.onupgradeneeded = function (event) {
        event.target.result.createObjectStore("cache");
    };
    request.onsuccess = function(event) {
        var db = event.target.result;
        var transaction = db.transaction(["cache"], 'readwrite');
        transaction.objectStore("cache").put(data, id);
    };
}

function getCached(id, success) {
    var request = indexedDB.open("cache", 1);
    request.onupgradeneeded = function (event) {
        event.target.result.createObjectStore("cache");
    };
    request.onsuccess = function(event) {
        var db = event.target.result;
        var transaction = db.transaction(["cache"], 'readwrite');
        transaction.objectStore("cache").get(id).onsuccess = function (event) {
            success(event.target.result);
        };
    };
}<commit_msg>removed unnecessary temp-vars from cache.js<commit_after>var indexedDB = window.indexedDB || window.mozIndexedDB || window.webkitIndexedDB || window.msIndexedDB;

function cache(id, data) {
    var request = indexedDB.open("cache", 1);
    request.onupgradeneeded = function (event) {
        event.target.result.createObjectStore("cache");
    };
    request.onsuccess = function(event) {
        event.target.result.transaction(["cache"], 'readwrite').objectStore("cache").put(data, id);
    };
}

function getCached(id, success) {
    var request = indexedDB.open("cache", 1);
    request.onupgradeneeded = function (event) {
        event.target.result.createObjectStore("cache");
    };
    request.onsuccess = function(event) {
        event.target.result.transaction(["cache"], 'readwrite').objectStore("cache").get(id).onsuccess = function (event) {
            success(event.target.result);
        };
    };
}
{'fraction_non_alphanumeric': 0.14917695473251028, 'fraction_numerical': 0.00205761316872428, 'mean_word_length': 3.4815668202764978, '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': '6224808', 'n_tokens_mistral': 590, 'n_tokens_neox': 572, 'n_words': 99}