commit 259a0ceaaf96a3c30d52cc029ea401b9ab36efb3
parent 1c39e618afa0f676467761bfe165f163513bd2be
Author: Whyme Lyu <callme5long@gmail.com>
Date: Sat, 18 May 2013 22:41:30 +0800
Remove warnings about variable shadowing
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/lib/sup/modes/thread-index-mode.rb b/lib/sup/modes/thread-index-mode.rb
@@ -876,8 +876,9 @@ protected
from << [(newness ? :index_new_color : (starred ? :index_starred_color : :index_old_color)), abbrev]
end
- dp = t.direct_participants.any? { |p| AccountManager.is_account? p }
- p = dp || t.participants.any? { |p| AccountManager.is_account? p }
+ is_me = AccountManager.method(:is_account?)
+ directly_participated = t.direct_participants.any?(&is_me)
+ participated = directly_participated || t.participants.any?(&is_me)
subj_color =
if t.has_label?(:draft)
@@ -907,7 +908,7 @@ protected
[
[:size_widget_color, size_widget_text],
[:to_me_color, t.labels.member?(:attachment) ? "@" : " "],
- [:to_me_color, dp ? ">" : (p ? '+' : " ")],
+ [:to_me_color, directly_participated ? ">" : (participated ? '+' : " ")],
] +
(t.labels - @hidden_labels).sort_by {|x| x.to_s}.map {
|label| [Colormap.sym_is_defined("label_#{label}_color".to_sym) || :label_color, "#{label} "]