<commit_before>// Hash that tracks modifications to assigned values
// Callers *must* use the set method to update values
export default function Parameters() {
  this.__mod__ = {};
}

var prototype = Parameters.prototype;

function key(name, index) {
  return (index >= 0 ? index + ':' : '') + name;
}

prototype.set = function(name, index, value, force) {
  var o = this,
      v = o[name],
      mod = o.__mod__;

  if (index >= 0) {
    if (v[index] !== value || force) {
      v[index] = value;
      mod[key(name, index)] = 1;
      mod[name] = 1;
    }
  } else if (v !== value || force) {
    o[name] = value;
    mod[name] = 1;
  }
};

prototype.modified = function(name, index) {
  var mod = this.__mod__, k;
  if (!arguments.length) {
    for (k in mod) { if (mod[k]) return 1; }
    return 0;
  }
  return mod[key(name, index)];
};

prototype.clear = function() {
  this.__mod__ = {};
};
<commit_msg>Do not enumerate Parameters mod hash.<commit_after>// Hash that tracks modifications to assigned values
// Callers *must* use the set method to update values
export default function Parameters() {
  Object.defineProperty(this, '__mod__', {writable:true, value: {}});
}

var prototype = Parameters.prototype;

function key(name, index) {
  return (index >= 0 ? index + ':' : '') + name;
}

prototype.set = function(name, index, value, force) {
  var o = this,
      v = o[name],
      mod = o.__mod__;

  if (index >= 0) {
    if (v[index] !== value || force) {
      v[index] = value;
      mod[key(name, index)] = 1;
      mod[name] = 1;
    }
  } else if (v !== value || force) {
    o[name] = value;
    mod[name] = 1;
  }
};

prototype.modified = function(name, index) {
  var mod = this.__mod__, k;
  if (!arguments.length) {
    for (k in mod) { if (mod[k]) return 1; }
    return 0;
  }
  return mod[key(name, index)];
};

prototype.clear = function() {
  this.__mod__ = {};
};

{'fraction_non_alphanumeric': 0.16816025303110174, 'fraction_numerical': 0.007380073800738007, 'mean_word_length': 2.91340206185567, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2722274', 'n_tokens_mistral': 666, 'n_tokens_neox': 646, 'n_words': 194}