From: William Morgan Date: Sun, 30 Dec 2007 03:11:14 +0000 (-0800) Subject: better documentation for Thread#first_useful_descendent X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=e047e53b436eaed1c323c037ad3abcbe7ef67f71;p=sup better documentation for Thread#first_useful_descendent --- diff --git a/lib/sup/thread.rb b/lib/sup/thread.rb index 880feb6..4d92ad3 100644 --- a/lib/sup/thread.rb +++ b/lib/sup/thread.rb @@ -185,6 +185,10 @@ class Container def root?; @parent.nil?; end def root; root? ? self : @parent.root; end + ## skip over any containers which are empty and have only one child. we use + ## this make the threaded display a little nicer, and only stick in the + ## "missing message" line when it's graphically necessary, i.e. when the + ## missing message has more than one descendent. def first_useful_descendant if empty? && @children.size == 1 @children.first.first_useful_descendant