Reformatted excerpts from Grant Hollingworth's message of 2008-01-18:
> To speed up the user's view of polling, deal with sources that affect
> the inbox before (for example) large mailing lists. It seemed tidier
> to implement this in Index rather than PollManager.
Very nice. One minor comment below.
> I changed "@sources.values" to "sources" in some other methods for
> clarity, which I think in this case outweighs lost efficiency.
Sounds good. And efficiency is the least of our concerns!
> + def sources
> + ## favour the inbox by listing non-archived sources first
> + @sources.values.sort_by {|s| s.id }.partition {|s| !s.archived? }.flatten
> + end
Why bother sorting by id at all? Why not just something like:
@sources.values.sort_by { |s| s.archived? ? 0 : 1 }
--
William <[EMAIL PROTECTED]>
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk