[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sup-devel] [PATCH] Use multiple body arrays when calling before-edit for each reply type
lib/sup/modes/reply-mode.rb:
> + @bodies[k] = Array.new(body)
Why is the body in an array?
lib/sup/modes/reply-mode.rb:
> + if !@edited
> + self.body = @bodies[@type_selector.val]
> + end
The idiomatic way to write this is:
self.body = @bodies[@type_selector.val] unless @edited
The EditMessageMode constructor also calls the before-edit hook, but I
guess if it wasn't broken before it won't be now.
lib/sup/modes/reply-mode.rb:
> + if new_body != @bodies[@type_selector.val]
> + @bodies[@type_selector.val] = new_body
> + @edited = true
> + end
Is there a reason we can't do this unconditionally?
_______________________________________________
Sup-devel mailing list
Sup-devel@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-devel