<commit_before>/* eslint-env es6 */
function iterativeLookup(args, cache, callback) {
  for (let i = 0; i < args.length; ++i) {
    if (i < args.length - 1) {
      if (!cache.has(args[i])) {
        cache.set(args[i], new Map());
      }
      cache = cache.get(args[i]);
    } else {
      if (!cache.has(args[i])) {
        cache.set(args[i], callback());
      }
      return cache.get(args[i]);
    }
  };
}

function recursiveLookup(args, cache, callback) {
  // base case
  if (args.length === 1) {
    if (!cache.has(args[0])) {
      cache.set(args[0], callback());
    }
    return cache.get(args[0]);
  }
  // recursive case
  if (!cache.has(args[0])) {
    cache.set(args[0], new Map());
  }
  // Testing out Babel's tail call optimization. This should be
  // transpiled into a while() loop. Repetitive sub-slicing of args
  // will cause heap fragmentation; the iterative version will be
  // be more performant in practice.
  recursiveLookup(args[1,-1], cache.get(args[0]), callback);
}
<commit_msg>stray semicolon<commit_after>/* eslint-env es6 */
function iterativeLookup(args, cache, callback) {
  for (let i = 0; i < args.length; ++i) {
    if (i < args.length - 1) {
      if (!cache.has(args[i])) {
        cache.set(args[i], new Map());
      }
      cache = cache.get(args[i]);
    } else {
      if (!cache.has(args[i])) {
        cache.set(args[i], callback());
      }
      return cache.get(args[i]);
    }
  }
}

function recursiveLookup(args, cache, callback) {
  // base case
  if (args.length === 1) {
    if (!cache.has(args[0])) {
      cache.set(args[0], callback());
    }
    return cache.get(args[0]);
  }
  // recursive case
  if (!cache.has(args[0])) {
    cache.set(args[0], new Map());
  }
  // Testing out Babel's tail call optimization. This should be
  // transpiled into a while() loop. Repetitive sub-slicing of args
  // will cause heap fragmentation; the iterative version will be
  // be more performant in practice.
  recursiveLookup(args[1,-1], cache.get(args[0]), callback);
}

{'fraction_non_alphanumeric': 0.17496303597831445, 'fraction_numerical': 0.011828486939379004, 'mean_word_length': 2.7316176470588234, 'pattern_counts': {'":': 0, '<': 7, '<?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': '6477993', 'n_tokens_mistral': 711, 'n_tokens_neox': 688, 'n_words': 179}