Skip to content

Commit

Permalink
died when table.length < 40
Browse files Browse the repository at this point in the history
  • Loading branch information
hitode909 committed Oct 3, 2011
1 parent b7dfa25 commit d4d0ae2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/plugins/mongo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ module Termtter::Client
table[status['retweeted_status']['id']]['rt_by'] << status['user']['screen_name']
}

table.to_a.sort_by{|pair| pair[0]}[-40..-1].each{|pair|
cut_length = [table.to_a.length, 40].min
table.to_a.sort_by{|pair| pair[0]}[cut_length..-1].each{|pair|
status = pair[1]['status']
fav_by = pair[1]['fav_by']
rt_by = pair[1]['rt_by']
Expand Down

0 comments on commit d4d0ae2

Please sign in to comment.