<commit_before>// --- Public functions --------------------------------------------------------

export const getCell = (world, x, y) => {
  for (let i = 0; i < world.length; i++) {
    const cell = world[i]
    if (cell[0] === x && cell[1] === y) return cell
  }
  return false
}

export const addCell = (world, x, y) => {
  const cellExists = getCell(world, x, y)
  return cellExists ? world : [...world, [x, y]]
}

export const removeCell = (world, x, y) => {
  return world.filter(([cellX, cellY]) => !(cellX === x && cellY === y))
}

export const tick = (world) => {
  let newWorld = []<commit_msg>comment<commit_after>// --- Public functions --------------------------------------------------------

export const getCell = (world, x, y) => {
  // this is often called function so we use for cycle because it has superior
  // performance compared to Array.prototype.find
  for (let i = 0; i < world.length; i++) {
    const cell = world[i]
    if (cell[0] === x && cell[1] === y) return cell
  }
  return false
}

export const addCell = (world, x, y) => {
  const cellExists = getCell(world, x, y)
  return cellExists ? world : [...world, [x, y]]
}

export const removeCell = (world, x, y) => {
  return world.filter(([cellX, cellY]) => !(cellX === x && cellY === y))
}

export const tick = (world) => {
  let newWorld = []
{'fraction_non_alphanumeric': 0.2528216704288939, 'fraction_numerical': 0.004514672686230248, 'mean_word_length': 2.251833740831296, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '6057955', 'n_tokens_mistral': 423, 'n_tokens_neox': 424, 'n_words': 146}