<commit_before>validObject = require("../../object/validate.coffee")

# Resets certain keys in global variables.
reset = (obj, method) ->
  obj.changed = false  if obj.changed
  if method is "draw"
    obj.frozen = false
    obj.update = true
    obj.first = false
  for o of obj
    reset obj[o], o  if validObject(obj[o])
  return

module.exports = reset
<commit_msg>fixed potential memory leak in reset function<commit_after>validObject = require("../../object/validate.coffee")

# Resets certain keys in global variables.
reset = (obj, method) ->
  obj.changed = false  if obj.changed
  if method is "draw"
    obj.frozen = false
    obj.update = true
    obj.first = false
  for o of obj
    reset obj[o], o if o.indexOf("d3plus") < 0 and validObject(obj[o])
  return

module.exports = reset

{'fraction_non_alphanumeric': 0.11794228356336262, 'fraction_numerical': 0.002509410288582183, 'mean_word_length': 3.1780104712041886, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '1183508', 'n_tokens_mistral': 256, 'n_tokens_neox': 250, 'n_words': 83}