Skip to content

Commit

Permalink
Simplify implementation of threaded_map
Browse files Browse the repository at this point in the history
  • Loading branch information
sferik committed Dec 7, 2012
1 parent 6de998c commit 184b5f8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/twitter/core_ext/enumerable.rb
@@ -1,9 +1,8 @@
module Enumerable

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

0 comments on commit 184b5f8

Please sign in to comment.