<commit_before>module Enumerable

  def threaded_each
    threads = []
    result = each do |object|
      threads << Thread.new{yield object}
    end
    threads.each(&:join)
    result
  end

  def threaded_map
    results = map{nil}
    threads = []
    each_with_index do |object, index|
      threads << Thread.new{results[index] = yield object}
    end
    threads.each(&:join)
    results
  end

end<commit_msg>Use Thread#value instead of Thread#join<commit_after>module Enumerable

  def threaded_each
    threads = []
    each do |object|
      threads << Thread.new{yield object}
    end
    threads.each(&:value)
  end

  def threaded_map
    threads = []
    each do |object|
      threads << Thread.new{yield object}
    end
    threads.map(&:value)
  end

end
{'fraction_non_alphanumeric': 0.09831824062095731, 'fraction_numerical': 0.0, 'mean_word_length': 2.7033492822966507, 'pattern_counts': {'":': 0, '<': 11, '<?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': '5258966', 'n_tokens_mistral': 253, 'n_tokens_neox': 239, 'n_words': 64}