<commit_before>const last20TempsArr = [];

const smoothValues = function(newvalue){
  last20TempsArr.unshift(newvalue);//Add new value to front of array

  //Lets keep it to twenty
  if(last20TempsArr.length <= 20)
    last20TempsArr.pop();

  let accumulator = 0;
  for (let temp of last20TempsArr) {
    accumulator += temp;
  }
  let smoothedValue = accumulator / last20TempsArr.length;
  smoothedValue = Math.round(smoothedValue);
  return smoothedValue;
};

module.exports = smoothValues;<commit_msg>Bug fix. Wrong direction on comparrison<commit_after>const last20TempsArr = [];

const smoothValues = function(newvalue){
  last20TempsArr.unshift(newvalue);//Add new value to front of array

  //Lets keep it to twenty
  if(last20TempsArr.length >= 20)
    last20TempsArr.pop();

  let accumulator = 0;
  for (let temp of last20TempsArr) {
    accumulator += temp;
  }
  let smoothedValue = accumulator / last20TempsArr.length;
  smoothedValue = Math.round(smoothedValue);
  return smoothedValue;
};

module.exports = smoothValues;
{'fraction_non_alphanumeric': 0.10135135135135136, 'fraction_numerical': 0.02895752895752896, 'mean_word_length': 4.373056994818653, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6158735', 'n_tokens_mistral': 381, 'n_tokens_neox': 334, 'n_words': 84}